From 972dc59b6fb1af69c79fd7c0d1ed1342e2f0c9b3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Sep 2014 04:25:24 +0200 Subject: m + add toString for classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma/AdjustmentMethodCapabilities.java | 23 +++++++++++ src/libgamma/CRTC.java | 10 +++++ src/libgamma/CRTCInformation.java | 54 +++++++++++++++++++++++--- src/libgamma/GammaRamps.java | 16 ++++++++ src/libgamma/LibgammaException.java | 10 +++++ src/libgamma/Partition.java | 11 ++++++ src/libgamma/Ramp.java | 9 +++++ src/libgamma/Site.java | 11 ++++++ 8 files changed, 139 insertions(+), 5 deletions(-) diff --git a/src/libgamma/AdjustmentMethodCapabilities.java b/src/libgamma/AdjustmentMethodCapabilities.java index 4d8f353..36cfbb9 100644 --- a/src/libgamma/AdjustmentMethodCapabilities.java +++ b/src/libgamma/AdjustmentMethodCapabilities.java @@ -140,5 +140,28 @@ public class AdjustmentMethodCapabilities */ public boolean fake; + + /** + * {@inheritDoc} + */ + public String toString() + { + return ""; + } + } diff --git a/src/libgamma/CRTC.java b/src/libgamma/CRTC.java index 8fc1ec9..15a0672 100644 --- a/src/libgamma/CRTC.java +++ b/src/libgamma/CRTC.java @@ -141,6 +141,16 @@ public class CRTC } + /** + * {@inheritDoc} + */ + public String toString() + { + return ""; + } + + /** * Create a CRTC state. diff --git a/src/libgamma/CRTCInformation.java b/src/libgamma/CRTCInformation.java index 1093357..532e984 100644 --- a/src/libgamma/CRTCInformation.java +++ b/src/libgamma/CRTCInformation.java @@ -203,11 +203,11 @@ public class CRTCInformation this.gamma_size_error = make_error(ints[12]); this.gamma_depth = (short)(ints[13]); this.gamma_depth_error = make_error(ints[14]); - this.gamma_support = ints[15]; + this.gamma_support = ints[15] != 0; this.gamma_support_error = make_error(ints[16]); this.subpixel_order = SubpixelOrder.VALUES[ints[17]]; this.subpixel_order_error = make_error(ints[18]); - this.active = ints[19]; + this.active = ints[19] != 0; this.active_error = make_error(ints[20]); this.connector_name_error = make_error(ints[21]); this.connector_type = ConnectorType.VALUES[ints[22]]; @@ -371,9 +371,9 @@ public class CRTCInformation /** - * Non-zero gamma ramp adjustments are supported. + * Whether gamma ramp adjustments are supported. */ - public final int gamma_support; + public final boolean gamma_support; /** * Error that occurred when fetching the value for @@ -399,7 +399,7 @@ public class CRTCInformation /** * Whether there is a monitors connected to the CRTC. */ - public final int active; + public final boolean active; /** * Error that occurred when fetching the value for @@ -481,6 +481,50 @@ public class CRTCInformation public final boolean has_error; + /** + * {@inheritDoc} + */ + public String toString() + { + String depth_str = Integer.toString(this.gamma_depth); + if (this.gamma_depth == -1) depth_str = "float"; + if (this.gamma_depth == -1) depth_str = "double"; + + return ""; + } + + /** * Convert a raw representation of an EDID to a lowercase hexadecimal representation. diff --git a/src/libgamma/GammaRamps.java b/src/libgamma/GammaRamps.java index 895ea2e..35f9d4b 100644 --- a/src/libgamma/GammaRamps.java +++ b/src/libgamma/GammaRamps.java @@ -146,6 +146,22 @@ public class GammaRamps } + /** + * {@inheritDoc} + */ + public String toString() + { + String depth_str = Integer.toString(this.depth); + if (this.depth == -1) depth_str = "float"; + if (this.depth == -1) depth_str = "double"; + + return ""; + } + + /** * Create and initialise a gamma ramp in the proper way that allows all adjustment * methods to read from and write to it without causing segmentation violation. diff --git a/src/libgamma/LibgammaException.java b/src/libgamma/LibgammaException.java index 79c41e8..bc8611e 100644 --- a/src/libgamma/LibgammaException.java +++ b/src/libgamma/LibgammaException.java @@ -378,6 +378,16 @@ public class LibgammaException extends Exception public final String string; + /** + * {@inheritDoc} + */ + @Override + public String toString() + { + return this.string; + } + + /** * Returns the name of the definition associated with diff --git a/src/libgamma/Partition.java b/src/libgamma/Partition.java index e5022a8..740bc11 100644 --- a/src/libgamma/Partition.java +++ b/src/libgamma/Partition.java @@ -102,6 +102,17 @@ public class Partition } + /** + * {@inheritDoc} + */ + public String toString() + { + return ""; + } + + /** * Create a partition state. diff --git a/src/libgamma/Ramp.java b/src/libgamma/Ramp.java index e3e7ec3..ef55f9d 100644 --- a/src/libgamma/Ramp.java +++ b/src/libgamma/Ramp.java @@ -57,6 +57,15 @@ public abstract class Ramp protected final long address; + /** + * {@inheritDoc} + */ + public String toString() + { + return ""; + } + + /** * Read the value of a stop in an 8-bit ramp. * diff --git a/src/libgamma/Site.java b/src/libgamma/Site.java index 7f52fa5..a23ce29 100644 --- a/src/libgamma/Site.java +++ b/src/libgamma/Site.java @@ -111,6 +111,17 @@ public class Site } + /** + * {@inheritDoc} + */ + public String toString() + { + return "" : this.site) + ", " + + "partitions_available = " + Integer.toString(this.partitions_available) + ">"; + } + + /** -- cgit v1.2.3-70-g09d2