Documentation of 'jvx.gui.PuColorBar' Java class
PuColorBar ("JavaView Reference Manual")
"JavaView? v5.03.003"
jvx.gui

Class PuColorBar

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf


    public class PuColorBar
    extends PsObject
    Java AWT component representing a color bar. It shows color representations for all values in the interval [minValue, maxValue].

    Optional (if controls are enabled), some textfields appear below the color bar, where the user can change the min/max values for the color range.

    There are three representations of values:

    • As an absolute value.
    • As a unit value, where 0 matches minValue and 1 matches maxValue. Values which are <0 or >1 are allowed and lie outside the view of the color bar.
    • As a color index in [0, 1]. The unit values are affine transformed and then cropped to [0, 1] resulting in the corresponding color index. The affine transformation is defined by the choice of transformMin, transformMax in [0, 1], which specify the range of the color table in the unit interval.
    See Also:
    Serialized Form
    Author:
    Matthias Nieser
    Version:
    12.12.2006, 2.00 revised (mn) Split into PuColorBar and PuColorBar_IP.
    09.12.2006, 1.15 revised (kp) Adjusted to Java 1.1.
    11.11.2006, 1.10 revised (mn) Added context menu and controls, cleaned code.
    26.09.2006, 1.00 created (mn)
    • Field Detail

      • COLOR_MAP_JAVAVIEW

        public final int COLOR_MAP_JAVAVIEW
        Use PuJvColorTable as color table.
        See Also:
        Constant Field Values
      • COLOR_MAP_3COLS

        public final int COLOR_MAP_3COLS
        Use PuTripleColorTable as color table.
        See Also:
        Constant Field Values
      • COLOR_MAP_BOOLEAN

        public final int COLOR_MAP_BOOLEAN
        Use PuBooleanColorTable as color table.
        See Also:
        Constant Field Values
      • INTERP_CONSTANT_LEFT

        public final int INTERP_CONSTANT_LEFT
        Interpolation rule. Each interval gets the color of its left node.
        See Also:
        Constant Field Values
      • INTERP_CONSTANT_RIGHT

        public final int INTERP_CONSTANT_RIGHT
        Interpolation rule. Each interval gets the color of its right node.
        See Also:
        Constant Field Values
      • INTERP_LINEAR

        public final int INTERP_LINEAR
        Interpolation rule. Linear interpolation between the nodes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PuColorBar

        public PuColorBar()
        Construct a new ColorBar without controls.
      • PuColorBar

        public PuColorBar(boolean controls)
        Construct a new ColorBar.
        Parameters:
        controls - Show controls below the bar.
      • PuColorBar

        public PuColorBar(boolean controls,
                          boolean allowMark,
                          boolean allowContextMenu)
        Construct a new ColorBar.
        Parameters:
        controls - Show controls below the bar.
        allowMark - Allow marked regions.
        allowContextMenu - Allow the context menu.
    • Method Detail

      • init

        public void init()
        If instance has missing name then assign default name 'Object_NUMBER' where number is the total number of already created instances.
        Overrides:
        init in class PsObject
      • update

        public boolean update(java.lang.Object event)
        Update all inspector panels, send update to all registered update listeners and finally update parent. Each of those updates has this object as event independent of the argument of this method.

        Central update method of this object. Must be overwritten if this class receives unknown events, say, from new children. Any subclass must class invoke super.update(event) on all events it does handle itself.

        Specified by:
        update in interface PsUpdateIf
        Overrides:
        update in class PsObject
        Parameters:
        event - carries a lot of information
        Returns:
        true if event has been handled, otherwise false
        See Also:
        PsObject.setParent(jv.object.PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(jv.object.PsUpdateIf)
      • setTransformMin

        public void setTransformMin(double transformMin)
        Set minimum bound for color map in [0, 1].
        Version:
        26.09.2006, 1.00 created (mn)
      • setTransformMax

        public void setTransformMax(double transformMax)
        Set maximum bound for color map in [0, 1].
        Version:
        26.09.2006, 1.00 created (mn)
      • setMinValue

        public void setMinValue(double minValue)
        Set minimum bound for color map as absolute value.
        Version:
        26.09.2006, 1.00 created (mn)
      • setMaxValue

        public void setMaxValue(double maxValue)
        Set maximum bound for color map as absolute value.
        Version:
        26.09.2006, 1.00 created (mn)
      • setBounds

        public void setBounds(double minValue,
                              double maxValue)
        Set minimum and maximum bound for color map.
        Version:
        26.09.2006, 1.00 created (mn)
      • setMinMark

        public void setMinMark(double minMark)
        Set left boundary of marked region in [0, 1].
      • setMaxMark

        public void setMaxMark(double maxMark)
        Set right boundary of marked region in [0, 1].
      • setColorTable

        public void setColorTable(PuColorMapIf colorTable)
        Set the color table.
      • setColorTable

        public void setColorTable(int ind)
        Set color map to one of the predefined color maps. See the public constants COLOR_MAP_...
        Version:
        11.11.2006, 1.00 created (mn)
      • setBackColor

        public void setBackColor(java.awt.Color bc)
        Set background color for excluded elements.
      • getBackColor

        public java.awt.Color getBackColor()
        Set background color for excluded elements.
      • setMarkColor

        public void setMarkColor(java.awt.Color mc)
        Set color for marked elements.
      • getMarkColor

        public java.awt.Color getMarkColor()
        Set color for marked elements.
      • allowMark

        public void allowMark(boolean allow)
        Set whether the user is allowed to mark regions in the color bar.
      • isMarkAllowed

        public boolean isMarkAllowed()
        Whether the user is allowed to mark regions in the color bar.
      • allowContextMenu

        public void allowContextMenu(boolean allow)
        Set whether the context menu is enabled.
      • isContextMenuAllowed

        public boolean isContextMenuAllowed()
        Whether the context menu is enabled.
      • transformAbsoluteValueToColorIndex

        public double transformAbsoluteValueToColorIndex(double value)
        Transforms an absolute value to the corresponding position in [0, 1] of the color in the color map.
        Version:
        26.09.2006, 1.00 created (mn)
      • getColor

        public java.awt.Color getColor(double value)
        Get color of an absolute value.
      • isMarked

        public boolean isMarked(double value)
        Whether an absolute value is marked.
      • setEnabled

        public void setEnabled(boolean state)
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

You see the box below because you did not login.