JavaGantt 2011.1 API

eu.beesoft.gaia.swing.form
Class EditableComponentBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by eu.beesoft.gaia.swing.form.EditableComponentBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border

public class EditableComponentBorder
extends javax.swing.border.AbstractBorder

Border used by Form to show that component is editable. If component is editable, the small marks are painted in its two opposite corners.

See Also:
Serialized Form

Constructor Summary
EditableComponentBorder()
          Creates a new instance of EditableComponentBorder with the default color [0,0,255].
EditableComponentBorder(java.awt.Color color)
          Creates a new instance of EditableComponentBorder with the given color.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Returns the border insets (initialized with values [3,4,3,4].
 java.awt.Color getColor()
          Gets the color of the border.
protected  void paintBorder(java.awt.Component c, boolean isEditable, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the border around given component, if it is editable.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the border around given component.
 void setColor(java.awt.Color color)
          Sets the color of the border.
 
Methods inherited from class javax.swing.border.AbstractBorder
getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditableComponentBorder

public EditableComponentBorder()
Creates a new instance of EditableComponentBorder with the default color [0,0,255].


EditableComponentBorder

public EditableComponentBorder(java.awt.Color color)
Creates a new instance of EditableComponentBorder with the given color.

Parameters:
color - - the color of border
Method Detail

getColor

public java.awt.Color getColor()
Gets the color of the border.

Returns:
the color

setColor

public void setColor(java.awt.Color color)
Sets the color of the border.

Parameters:
color - - the color to set

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns the border insets (initialized with values [3,4,3,4].

Specified by:
getBorderInsets in interface javax.swing.border.Border
Overrides:
getBorderInsets in class javax.swing.border.AbstractBorder
Returns:
the border insets

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border around given component. Redirects a call to paintBorder(Component, boolean, Graphics, int, int, int, int) method.

Specified by:
paintBorder in interface javax.swing.border.Border
Overrides:
paintBorder in class javax.swing.border.AbstractBorder
Parameters:
c - - component that requests to paint the border
g - - graphics to paint on
x - - horizontal coordinate
y - - vertical coordinate
width - - width of border
height - - height of border

paintBorder

protected void paintBorder(java.awt.Component c,
                           boolean isEditable,
                           java.awt.Graphics g,
                           int x,
                           int y,
                           int width,
                           int height)
Paints the border around given component, if it is editable. It paints small marks in two opposite corners. Override this method to change the look of border.

Parameters:
c - - component that requests to paint the border
isEditable - - true if given component is editable
g - - graphics to paint on
x - - horizontal coordinate
y - - vertical coordinate
width - - width of border
height - - height of border

JavaGantt 2011.1 API