Class TerraMeterSkin

    • Constructor Detail

      • TerraMeterSkin

        public TerraMeterSkin()
    • Method Detail

      • install

        public void install​(Component component)
        Description copied from class: ComponentSkin
        Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.
        Specified by:
        install in interface Skin
        Overrides:
        install in class ComponentSkin
        Parameters:
        component - The component to which the skin is being attached.
      • isFocusable

        public boolean isFocusable()
        Description copied from class: ComponentSkin
        By default, skins are focusable.
        Specified by:
        isFocusable in interface Skin
        Overrides:
        isFocusable in class ComponentSkin
        Returns:
        true if this skin is focusable; false, otherwise.
      • getPreferredWidth

        public int getPreferredWidth​(int height)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred width given the provided height constraint.
        Specified by:
        getPreferredWidth in interface ConstrainedVisual
        Parameters:
        height - The height by which to constrain the preferred width, or -1 for no constraint.
        Returns:
        The preferred width given the height constraint.
      • getPreferredHeight

        public int getPreferredHeight​(int width)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred height given the provided width constraint.
        Specified by:
        getPreferredHeight in interface ConstrainedVisual
        Parameters:
        width - The width by which to constrain the preferred height, or -1 for no constraint.
        Returns:
        The preferred height given the width constraint.
      • getBaseline

        public int getBaseline​(int width,
                               int height)
        Description copied from class: ComponentSkin
        Should be implemented in every subclass.

        The default implementation here simply returns -1 (no baseline).

        Specified by:
        getBaseline in interface ConstrainedVisual
        Overrides:
        getBaseline in class ComponentSkin
        Parameters:
        width - Constrained width to compute the baseline for.
        height - Constrained height to compute the baseline for.
        Returns:
        The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.
      • layout

        public void layout()
        Description copied from interface: Skin
        If the component on which the skin is installed is a container, lays out the container's children.
        Specified by:
        layout in interface Skin
      • paint

        public void paint​(java.awt.Graphics2D graphics)
        Description copied from interface: Visual
        Paints the visual.
        Specified by:
        paint in interface Visual
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • getColor

        public java.awt.Color getColor()
      • setColor

        public void setColor​(java.awt.Color color)
      • setColor

        public final void setColor​(java.lang.String color)
      • setColor

        public final void setColor​(int color)
      • getGridColor

        public java.awt.Color getGridColor()
      • setGridColor

        public void setGridColor​(java.awt.Color gridColor)
      • setGridColor

        public final void setGridColor​(java.lang.String gridColor)
      • setGridColor

        public final void setGridColor​(int gridColor)
      • getTextColor

        public java.awt.Color getTextColor()
      • setTextColor

        public void setTextColor​(java.awt.Color color)
      • setTextColor

        public final void setTextColor​(java.lang.String color)
      • setTextColor

        public final void setTextColor​(int color)
      • getTextFillColor

        public java.awt.Color getTextFillColor()
      • setTextFillColor

        public void setTextFillColor​(java.awt.Color color)
      • setTextFillColor

        public final void setTextFillColor​(java.lang.String color)
      • setTextFillColor

        public final void setTextFillColor​(int color)
      • getGridFrequency

        public float getGridFrequency()
      • setGridFrequency

        public void setGridFrequency​(float gridFrequency)
      • setGridFrequency

        public final void setGridFrequency​(java.lang.Number gridFrequency)
      • getFont

        public java.awt.Font getFont()
      • setFont

        public void setFont​(java.awt.Font font)
      • setFont

        public final void setFont​(java.lang.String font)
      • setFont

        public final void setFont​(Dictionary<java.lang.String,​?> font)
      • percentageChanged

        public void percentageChanged​(Meter meter,
                                      double previousPercentage)
        Listener for meter percentage changes.
        Specified by:
        percentageChanged in interface MeterListener
        Parameters:
        meter - The source of the event.
        previousPercentage - The previous percentage value.
      • textChanged

        public void textChanged​(Meter meter,
                                java.lang.String previousText)
        Listener for meter text changes.
        Specified by:
        textChanged in interface MeterListener
        Parameters:
        meter - The source of the event.
        previousText - The previous text value.
      • orientationChanged

        public void orientationChanged​(Meter meter)
        Listener for meter orientation changes.
        Specified by:
        orientationChanged in interface MeterListener
        Parameters:
        meter - The source of the event.