Class JTriggeredButtonBorder

java.lang.Object
javax.swing.border.AbstractBorder
org.sm.smtools.swing.util.JTriggeredButtonBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border

public final class JTriggeredButtonBorder
extends javax.swing.border.AbstractBorder
The JTriggeredButtonBorder class provides a special border for the JTriggeredButton class.

Note that this class cannot be subclassed!

Version:
22/04/2002
Author:
Sven Maerivoet
See Also:
JTriggeredButton, Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    JTriggeredButtonBorder()
    Creates a JTriggeredButtonBorder with default dark gray and white border colors.
    JTriggeredButtonBorder​(boolean isBackgroundDark, boolean isSunk)
    Creates a JTriggeredButtonBorder with specfied border colors.
  • Method Summary

    Modifier and Type Method Description
    java.awt.Insets getBorderInsets​(java.awt.Component c)
    Returns the margins used by the border
    boolean isBorderOpaque()
    This method always returns false because the border is made transparent.
    void paintBorder​(java.awt.Component component, java.awt.Graphics gr, int x, int y, int width, int height)  
    void setInsets​(java.awt.Insets insets)
    Sets the margins used by the border.

    Methods inherited from class javax.swing.border.AbstractBorder

    getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JTriggeredButtonBorder

      public JTriggeredButtonBorder()
      Creates a JTriggeredButtonBorder with default dark gray and white border colors.
      See Also:
      JTriggeredButtonBorder(boolean,boolean), JTriggeredButton
    • JTriggeredButtonBorder

      public JTriggeredButtonBorder​(boolean isBackgroundDark, boolean isSunk)
      Creates a JTriggeredButtonBorder with specfied border colors.
      Parameters:
      isBackgroundDark - if the background is dark, this flag specifies the use of a light border color
      isSunk - specifies whether or not the border is sunk or raised
      See Also:
      JTriggeredButtonBorder(), JTriggeredButton
  • Method Details

    • setInsets

      public void setInsets​(java.awt.Insets insets)
      Sets the margins used by the border.
      Parameters:
      insets - the margins used by the border
      See Also:
      getBorderInsets(Component)
    • getBorderInsets

      public java.awt.Insets getBorderInsets​(java.awt.Component c)
      Returns the margins used by the border

      Note that this method does not return the insets of the specified component!

      Specified by:
      getBorderInsets in interface javax.swing.border.Border
      Overrides:
      getBorderInsets in class javax.swing.border.AbstractBorder
      Returns:
      the margins used by this border
      See Also:
      setInsets(Insets)
    • paintBorder

      public void paintBorder​(java.awt.Component component, java.awt.Graphics gr, int x, int y, int width, int height)
      Specified by:
      paintBorder in interface javax.swing.border.Border
      Overrides:
      paintBorder in class javax.swing.border.AbstractBorder
    • isBorderOpaque

      public boolean isBorderOpaque()
      This method always returns false because the border is made transparent.
      Specified by:
      isBorderOpaque in interface javax.swing.border.Border
      Overrides:
      isBorderOpaque in class javax.swing.border.AbstractBorder
      Returns:
      always false