All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.BorderPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----symantec.itools.awt.BorderPanel
- public class BorderPanel
- extends Panel
- implements AlignStyle, BevelStyle
BorderPanel is a panel component that has an optional border
and optional text title.
-
borderColor
- The border color.
-
internalInsets
- The internal border insets.
-
ixPad
- The side border inset padding amount, in pixels.
-
iyPadBottom
- The bottom border inset padding amount, in pixels.
-
iyPadTop
- The top border inset padding amount, in pixels.
-
label
- The text label to display in the border.
-
labelAlignment
- The border label alignment: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT.
-
labelColor
- The border label color.
-
labelipadx
- Label horizontal coordinate inset constant, in pixels.
-
labelpadx
- Label horizontal coordinate padding constant, in pixels.
-
padbottom
- The bottom border outside padding amount, in pixels.
-
padleft
- The left border outside padding amount, in pixels.
-
padright
- The right border outside padding amount, in pixels.
-
padtop
- The top border outside padding amount, in pixels.
-
panel
- The panel within the border.
-
style
- The border style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE.
-
BorderPanel()
- Constructs a new default BorderPanel.
-
BorderPanel(int)
- Constructs a new BorderPanel with the specified beveled border style.
-
BorderPanel(String)
- Constructs a new BorderPanel with the specified border label.
-
BorderPanel(String, int)
- Constructs a new BorderPanel with the specified border label
and given alignment.
-
BorderPanel(String, int, int)
- Constructs a new BorderPanel with the specified border label
and given alignment and border styles.
-
add(Component)
- Adds a component to the end of this container.
-
add(Component, int)
- Inserts a component into this container at the given position.
-
add(String, Component)
- Adds a component to the end of this container and to the layout manager.
-
addNotify()
- Tells this component that it has been added to a container.
-
countComponents()
- Returns the number of components in this container.
-
getAlignStyle()
- Gets the current border label alignment.
-
getBevelStyle()
- Gets the current border style.
-
getBorderColor()
- Gets the current border color.
-
getComponent(int)
- Gets the component at the specified zero-relative component index.
-
getComponents()
- Returns all of the components in this container.
-
getInternalInsets()
- Gets the current internal border insets.
-
getIPadBottom()
- Gets the current bottom border inset padding amount, in pixels.
-
getIPadSides()
- Gets the current side border inset padding amount, in pixels.
-
getIPadTop()
- Gets the current top border inset padding amount, in pixels.
-
getLabel()
- Returns the text label displayed in the border.
-
getLabelColor()
- Gets the current border label color.
-
getLabelTopMargin()
- Returns the current margin above the label.
-
getLayout()
- Gets the current border panel layout manager.
-
getPaddingBottom()
- Gets the current bottom border outside padding amount, in pixels.
-
getPaddingLeft()
- Gets the current left border outside padding amount, in pixels.
-
getPaddingRight()
- Gets the current right border outside padding amount, in pixels.
-
getPaddingTop()
- Gets the current top border outside padding amount, in pixels.
-
insets()
- Returns the amount of space used by the current border.
-
layout()
- Handles the laying out of components within this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
remove(Component)
- Removes the specified component from this container.
-
removeAll()
- Removes all the components from this container.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
setAlignStyle(int)
- Sets the border label alignment.
-
setBackground(Color)
- Sets this component's background color.
-
setBevelStyle(int)
- Sets the border style.
-
setBorderColor(Color)
- Sets the current border color.
-
setBorderColor(Color, boolean)
- Sets the current border color, and optionally the border label color.
-
setInternalInsets(Insets)
- Sets the internal border insets.
-
setIPadBottom(int)
- Sets the bottom border inset padding amount, in pixels.
-
setIPadSides(int)
- Sets the side border inset padding amount, in pixels.
-
setIPadTop(int)
- Sets the top border inset padding amount, in pixels.
-
setLabel(String)
- Sets the text label to display in the border.
-
setLabelColor(Color)
- Sets the border label color.
-
setLayout(LayoutManager)
- Sets the layout manager to be used to layout this container.
-
setPadding(int, int, int, int)
- Sets the border padding amounts.
-
setPaddingBottom(int)
- Sets the bottom border outside padding amount, in pixels.
-
setPaddingLeft(int)
- Sets the left border outside padding amount, in pixels.
-
setPaddingRight(int)
- Sets the right border outside padding amount, in pixels.
-
setPaddingTop(int)
- Sets the top border outside padding amount, in pixels.
-
update(Graphics)
- Handles redrawing of this component on the screen.
labelpadx
protected final static int labelpadx
- Label horizontal coordinate padding constant, in pixels.
labelipadx
protected final static int labelipadx
- Label horizontal coordinate inset constant, in pixels.
borderColor
protected Color borderColor
- The border color.
labelColor
protected Color labelColor
- The border label color.
padtop
protected int padtop
- The top border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
padbottom
protected int padbottom
- The bottom border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
padleft
protected int padleft
- The left border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
padright
protected int padright
- The right border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
ixPad
protected int ixPad
- The side border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- See Also:
- panel
iyPadTop
protected int iyPadTop
- The top border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- See Also:
- panel
iyPadBottom
protected int iyPadBottom
- The bottom border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- See Also:
- panel
style
protected int style
- The border style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE.
- See Also:
- BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
label
protected String label
- The text label to display in the border.
labelAlignment
protected int labelAlignment
- The border label alignment: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT.
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
internalInsets
protected Insets internalInsets
- The internal border insets.
The left and right fields are used while determining the preferred
width of this component.
panel
protected Panel panel
- The panel within the border. This is the panel that contains the
components added to the BorderPanel.
BorderPanel
public BorderPanel()
- Constructs a new default BorderPanel.
Its label will be ALIGN_CENTERED and it will have a BEVEL_LINE style border.
BorderPanel
public BorderPanel(int style)
- Constructs a new BorderPanel with the specified beveled border style.
It will have the ALIGN_CENTERED label alignment style.
- Parameters:
- style - the desired beveled border style
- See Also:
- BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
BorderPanel
public BorderPanel(String s)
- Constructs a new BorderPanel with the specified border label.
Its label will be ALIGN_CENTERED and it will have a BEVEL_LINE style border.
- Parameters:
- s - the label for the panel's border
BorderPanel
public BorderPanel(String s,
int alignment)
- Constructs a new BorderPanel with the specified border label
and given alignment.
- Parameters:
- s - the label for the panel's border
- alignment - the label alignment
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
BorderPanel
public BorderPanel(String s,
int alignment,
int style)
- Constructs a new BorderPanel with the specified border label
and given alignment and border styles.
- Parameters:
- s - the label for the panel's border
- alignment - the label alignment
- style - the border bevel style
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
addNotify
public void addNotify()
- Tells this component that it has been added to a container.
This is a standard Java AWT method which gets called by the AWT when
this component is added to a container. Typically, it is used to
create this component's peer.
It is overridden here to resize self after peer created.
- Overrides:
- addNotify in class Panel
- See Also:
- removeNotify
setPaddingTop
public void setPaddingTop(int p)
- Sets the top border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Parameters:
- p - the top border outside padding amount, in pixels
- See Also:
- getPaddingTop
getPaddingTop
public int getPaddingTop()
- Gets the current top border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Returns:
- the top border outside padding amount, in pixels
- See Also:
- setPaddingTop
setPaddingBottom
public void setPaddingBottom(int p)
- Sets the bottom border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Parameters:
- p - the bottom border outside padding amount, in pixels
- See Also:
- getPaddingBottom
getPaddingBottom
public int getPaddingBottom()
- Gets the current bottom border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Returns:
- the bottom border outside padding amount, in pixels
- See Also:
- setPaddingBottom
setPaddingLeft
public void setPaddingLeft(int p)
- Sets the left border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Parameters:
- p - the left border outside padding amount, in pixels
- See Also:
- getPaddingLeft
getPaddingLeft
public int getPaddingLeft()
- Gets the current left border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Returns:
- the left border outside padding amount, in pixels
- See Also:
- setPaddingLeft
setPaddingRight
public void setPaddingRight(int p)
- Sets the right border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Parameters:
- p - the right border outside padding amount, in pixels
- See Also:
- getPaddingRight
getPaddingRight
public int getPaddingRight()
- Gets the current right border outside padding amount, in pixels.
This is the distance between the drawn border and the actual
bounds of the component.
- Returns:
- the right border outside padding amount, in pixels
- See Also:
- setPaddingRight
setIPadTop
public void setIPadTop(int t)
- Sets the top border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Parameters:
- t - top border inset padding amount
- See Also:
- getIPadTop, panel
setIPadBottom
public void setIPadBottom(int b)
- Sets the bottom border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Parameters:
- b - bottom border inset padding amount
- See Also:
- getIPadBottom, panel
getIPadTop
public int getIPadTop()
- Gets the current top border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Returns:
- top border inset padding amount
- See Also:
- setIPadTop, panel
setIPadSides
public void setIPadSides(int s)
- Sets the side border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Parameters:
- s - side border inset padding amount
- See Also:
- getIPadSides, panel
getIPadBottom
public int getIPadBottom()
- Gets the current bottom border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Returns:
- bottom border inset padding amount
- See Also:
- setIPadBottom, panel
setPadding
public void setPadding(int t,
int b,
int l,
int r)
- Sets the border padding amounts.
This are the distances between the drawn border and the actual
bounds of the component.
- Parameters:
- t - the top padding amount
- b - the bottom padding amount
- l - the left padding amount
- r - the right padding amount
getIPadSides
public int getIPadSides()
- Gets the current side border inset padding amount, in pixels.
This is the distance between the drawn border and the usable
area within the border. It is used to determine the size of the
panel contained within this component's borders.
- Returns:
- side border inset padding amount
- See Also:
- setIPadSides, panel
setLabel
public void setLabel(String s)
- Sets the text label to display in the border.
- Parameters:
- s - the new border label. If null, label is removed
- See Also:
- getLabel
getLabel
public String getLabel()
- Returns the text label displayed in the border.
- See Also:
- setLabel
setBorderColor
public void setBorderColor(Color clr,
boolean useForLabel)
- Sets the current border color, and optionally the border label color.
- Parameters:
- clr - the new border color
- useForLabel - if true use the new border color for the label color
as well
- See Also:
- getBorderColor
setBorderColor
public void setBorderColor(Color clr)
- Sets the current border color.
- Parameters:
- clr - the new border color
- See Also:
- getBorderColor
getBorderColor
public Color getBorderColor()
- Gets the current border color.
- Returns:
- the current border color
- See Also:
- setBorderColor
setAlignStyle
public void setAlignStyle(int alignment)
- Sets the border label alignment.
- Parameters:
- alignment - the new border label alignment.
One of ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- getAlignStyle, ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
getAlignStyle
public int getAlignStyle()
- Gets the current border label alignment.
- Returns:
- the current border label alignment.
One of ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, setAlignStyle
setLabelColor
public void setLabelColor(Color clr)
- Sets the border label color.
- Parameters:
- clr - the new border label color
- See Also:
- getLabelColor
getLabelColor
public Color getLabelColor()
- Gets the current border label color.
- Returns:
- the current border label color
setBevelStyle
public void setBevelStyle(int s)
- Sets the border style.
- Parameters:
- s - the new border style.
One of BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- See Also:
- BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE, getBevelStyle
getBevelStyle
public int getBevelStyle()
- Gets the current border style.
- Returns:
- current border style.
One of BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- See Also:
- BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE, setBevelStyle
setInternalInsets
public void setInternalInsets(Insets insets)
- Sets the internal border insets.
The left and right fields of the internal insets are used while
determining the preferred width of this component.
- Parameters:
- insets - the new internal border insets
- See Also:
- getInternalInsets
getInternalInsets
public Insets getInternalInsets()
- Gets the current internal border insets.
The left and right fields of the internal insets are used while
determining the preferred width of this component.
- Returns:
- the current internal border insets
- See Also:
- setInternalInsets
layout
public void layout()
- Handles the laying out of components within this component.
This is a standard Java AWT method which gets called by the AWT
when this component is validated with the validate() method.
- Overrides:
- layout in class Container
- See Also:
- validate
minimumSize
public Dimension minimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component. The minimum size of this component
is equal to the preferred size.
- Overrides:
- minimumSize in class Container
- See Also:
- preferredSize
preferredSize
public Dimension preferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component. The size returned is large
enough to display the entire border label and the panel within the
border.
- Overrides:
- preferredSize in class Container
- See Also:
- minimumSize
setLayout
public void setLayout(LayoutManager l)
- Sets the layout manager to be used to layout this container.
This is a standard Java AWT method which gets called to specify
which layout manager should be used to layout the components in
standard containers.
- Parameters:
- l - the layout manager to use to layout this container's components
- Overrides:
- setLayout in class Container
- See Also:
- getLayout
getLayout
public LayoutManager getLayout()
- Gets the current border panel layout manager.
- Returns:
- current LayoutManager of border panel
- Overrides:
- getLayout in class Container
- See Also:
- setLayout
add
public Component add(Component c)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. The specified component is added to
the end of this container.
- Parameters:
- c - the component to add
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove
add
public Component add(String s,
Component c)
- Adds a component to the end of this container and to the layout manager.
This is a standard Java AWT method which gets called to add a
component to a container. The specified component is added to
the end of this container, and also added to this container's
layout manager with the given name.
- Parameters:
- name - the positioning directive for the layout manager
- c - the component to add
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove
add
public Component add(Component c,
int pos)
- Inserts a component into this container at the given position.
This is a standard Java AWT method which gets called to add a
component to a container. The specified component is added to
this container at the given zero-relative position index. A
position index of -1 appends the component to the end.
- Parameters:
- c - the component to add
- pos - the zero-relative index at which to add the component or -1 for end
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove
remove
public void remove(Component c)
- Removes the specified component from this container.
This is a standard Java AWT method which gets called to remove a
component from a container. When this happens the component's
removeNotify() will also get called to indicate component removal.
- Parameters:
- c - the component to remove
- Overrides:
- remove in class Container
- See Also:
- removeAll, add
removeAll
public void removeAll()
- Removes all the components from this container.
This is a standard Java AWT method which gets called to remove all
the components from a container. When this happens each component's
removeNotify() will also get called to indicate component removal.
- Overrides:
- removeAll in class Container
- See Also:
- remove, add
reshape
public void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
The graphics context clipping region is set to the bounding rectangle
of this component and its <0,0> coordinate is this component's
top-left corner.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
- Parameters:
- g - the graphics context
- Overrides:
- update in class Component
- See Also:
- repaint, paint
countComponents
public int countComponents()
- Returns the number of components in this container.
This is a standard Java AWT method which gets called to return a count
of the components within this container.
- Overrides:
- countComponents in class Container
getComponent
public Component getComponent(int i)
- Gets the component at the specified zero-relative component index.
This is a standard Java AWT method which gets called to return
the component at a specific position.
- Parameters:
- i - the zero-relative index of the component to retrieve
- Returns:
- the component at the given index
- Throws: ArrayIndexOutOfBoundsException
- if the given
component index does not exist
- Overrides:
- getComponent in class Container
- See Also:
- getComponents
getComponents
public Component[] getComponents()
- Returns all of the components in this container.
This is a standard Java AWT method which gets called to return
an array of all of the components in this container.
- Returns:
- an array of components in this container
- Overrides:
- getComponents in class Container
- See Also:
- getComponent
insets
public Insets insets()
- Returns the amount of space used by the current border.
This is a standard Java AWT method which gets called to determine
the size of the current border. The returned value is the width
of each border side in pixels.
- Returns:
- the current border insets
- Overrides:
- insets in class Container
paint
public void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its <0,0>
coordinate is this component's top-left corner.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Container
- See Also:
- repaint, update
getLabelTopMargin
protected int getLabelTopMargin()
- Returns the current margin above the label.
setBackground
public void setBackground(Color c)
- Sets this component's background color.
This is a standard Java AWT method which gets called to change
the background color of this component.
- Parameters:
- c - the new background color
- Overrides:
- setBackground in class Component
- See Also:
- getBackground
All Packages Class Hierarchy This Package Previous Next Index