John W. Campbell
This class provides a horizontal or vertical separator for separating
components on a display.
Class, fields, constructor and methods:
Class Details
Accessible Fields
Constructor
Resource Methods
Standard Positioning and Sizing
Overriden Superclass Methods
- Package:
- Jdl.JdlView;
- Class name:
- JdlSeparator
- Class definition:
- public class JdlSeparator
- Extends:
- JPanel
- Implements:
- none
- Actions:
- none
The following accessible fields have been defined:
- public final static int SOLID_LINE
- Separator type option: solid.
- public final static int ETCHED_OUT
- Separator type option: etched out.
- public final static int ETCHED_IN
- Separator type option: etched_in.
- public final static int HORIZONTAL
- Separator direction: horizontal.
- public final static int VERTICAL
- Separator direction: vertical.
- static final long serialVersionUID
- public final static int PREFERRED
- Size Constraint: preferred size.
- public final static int FREE
- Size/Location Constraint: free.
A single constructor is available.
Constructor:
Default constructor
Constructs a separator with default resources.
- Constructor Definition:
- public JdlSeparator ()
- Parameters List:
- none
This section has methods to set/get the resources associated with the
object determining its appearance and mode of action.
Methods:
Set length type - setFixedLength
Get length type - getFixedLength
Set orientation - setOrientation
Get orientation - getOrientation
Set length - setSeparatorLength
Get length - getSeparatorLength
Set thickness - setSeparatorThickness
Get thickness - getSeparatorThickness
Set style - setSeparatorType
Get style - getSeparatorType
This method sets the fixed/variable length resource.
- Method Definition:
- public void setFixedLength (boolean fixed)
- Parameters List:
- fixed
- For fixed length set to true, for variable length set to false
(the default).
This method returns the fixed/variable length resource.
- Method Definition:
- public boolean getFixedLength()
- Parameters List:
- none
- Method Return:
-
Returns true for fixed length, false for varaible length separator.
This method sets the separator orientation resource.
- Method Definition:
- public void setOrientation (int orient)
- Parameters List:
- orient
- Orientation flag:
= 0, horizontal (the default)
= 1, vertical
(May use the variables HORIZONTAL, VERTICAL)
This method returns the separator orientation resource.
- Method Definition:
- public int getOrientation()
- Parameters List:
- none
- Method Return:
-
Returns the orientation flag:
= 0, horizontal
= 1, vertical
This method sets the separator length resource.
- Method Definition:
- public void setSeparatorLength (int length)
- Parameters List:
- length
- The required length of the separator (default = 20). If the
length is variable, then this will be used as a minimum length.
This method returns the separator length resource.
- Method Definition:
- public int getSeparatorLength()
- Parameters List:
- none
- Method Return:
-
Returns the requested length of the separator.
This method sets the separator thickness resource.
- Method Definition:
- public void setSeparatorThickness (int separator)
- Parameters List:
- thickness
- This is the required separator thickness in pixels.
For three dimensional separators, an odd number will be
rounded up to the next even number when used. (default = 4)
This method returns the separator thickness resource.
- Method Definition:
- public int getSeparatorThickness()
- Parameters List:
- none
- Method Return:
-
Returns the separator thickness in pixels.
This method sets the separator type resource.
- Method Definition:
- public void setSeparatorType (int type)
- Parameters List:
- type
- Separator type flag:
= 0, solid line
= 1, etched out
= 2, etched in (the default)
(May use the variables SOLID_LINE, ETCHED_OUT, ETCHED_IN)
This method returns the separator type resource.
- Method Definition:
- public int getSeparatorType()
- Parameters List:
- none
- Method Return:
-
Returns the current separator type flag:
= 0, solid line
= 1, etched out
= 2, etched in
This section contains the standard methods for positioning and sizing
the object.
Methods:
Set position constraints - setLocationConstraints
Set size constraints - setSizeConstraints
Set minimum height - setMinimumHeight
Set minimum width - setMinimumWidth
Set constraints on the Jdl object positioning.
- Method Definition:
- public void setLocationConstraints (int constraint_x, int constraint_y)
- Parameters List:
- constraint_x
- Constrain the Jdl Object 'x' position = the required
Jdl Object 'x' position (overrides setLocation method) or FREE if the 'x'
position may be set by the setLocation method and hence possibly by the
layout manager.
- constraint_y
- Constrain the Jdl Object 'y' position = the required
the Jdl Object 'y'position (overrides setLocation method) or FREE if the 'y'
position may be set by the setLocation method and hence possibly by the
layout manager.
Set constraints on the Jdl Object resizing permitted.
- Method Definition:
- public void setSizeConstraints (int constraint_w, int constraint_h)
- Parameters List:
- constraint_w
- Constrain the Jdl Object width = the required
Jdl Object width, or PREFERRED (default) if the width is to be calculated
from the current resources, or FREE if the width may be resized to anything
greater than the minimum width required.
- constraint_h
- Constrain the Jdl Object height = the required
Jdl Object height, or PREFERRED (default) if the height is to be calculated
from the current resources, or FREE if the height may be resized to anything
greater than the minimum height required.
Set the minimum height resource.
- Method Definition:
- public void setMinimumHeight(int minh)
- Parameters List:
- minh
- The minimum height required for the object (ignored if less
than that required by the minimum layout) (default = 0).
Set the minimum width resource.
- Method Definition:
- public void setMinimumWidth(int minw)
- Parameters List:
- minh
- The minimum width required for the object (ignored if less
than that required by the minimum layout) (default = 0).
This section contains methods which override the corresponding superclass
methods. These are basically standard for JdlView objects and comprise
methods to set background and foreground colours and to get the minimum
and preferred sizes for the object. (The paintComponent method is also
over-ridden but is not normally called by the user).
Methods:
Set background - setBackground
Set background colours - setBackground
Set foreground - setForeground
Get minimum size - getMinimumSize
Get preferred size - getPreferredSize
This method sets the background colour resource.
- Method Definition:
- public void setBackground (Color c)
- Parameters List:
- c
- The color to become this object's background color.
This method sets the background colour resource and brighter and darker shades
of that colour (e.g. for 3-D frames).
- Method Definition:
- public void setBackground (Color c, Color brighter, Color darker)
- Parameters List:
- c
- The background colour.
- brighter
- A brighter shade of the background colour.
- darker
- A darker shade of the background colour.
This method sets the foreground colour resource.
- Method Definition:
- public void setForeground (Color c)
- Parameters List:
- c
- The color to become this object's foreground color.
This method returns the minimum size of the component.
- Method Definition:
- public Dimension getMinimumSize()
- Parameters List:
- none
This method returns the preferred size of the component.
- Method Definition:
- public Dimension getPreferredSize()
- Parameters List:
- none
⇑ Up 3
⇑ Up 2
⇑ Up 1
⇑ Top of this