3.10.10 - Separator - JdlSeparator

John W. Campbell

3.10.10.1 Introduction

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

3.10.10.2 Class Details

Package:
Jdl.JdlView;
Class name:
JdlSeparator
Class definition:
public class JdlSeparator
Extends:
JPanel
Implements:
none
Actions:
none

3.10.10.3 Accessible Fields

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.

3.10.10.4 Constructor

3.10.10.4.1 Introduction

A single constructor is available.

Constructor:

Default constructor

3.10.10.4.2 Default constructor

Constructs a separator with default resources.

Constructor Definition:
public JdlSeparator ()
Parameters List:
none

3.10.10.5 Resource Methods

3.10.10.5.1 Introduction

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

3.10.10.5.2 Set length type - setFixedLength

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).

3.10.10.5.3 Get length type - getFixedLength

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.

3.10.10.5.4 Set orientation - setOrientation

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)

3.10.10.5.5 Get orientation - getOrientation

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

3.10.10.5.6 Set length - setSeparatorLength

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.

3.10.10.5.7 Get length - getSeparatorLength

This method returns the separator length resource.

Method Definition:
public int getSeparatorLength()
Parameters List:
none
Method Return:
Returns the requested length of the separator.

3.10.10.5.8 Set thickness - setSeparatorThickness

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)

3.10.10.5.9 Get thickness - getSeparatorThickness

This method returns the separator thickness resource.

Method Definition:
public int getSeparatorThickness()
Parameters List:
none
Method Return:
Returns the separator thickness in pixels.

3.10.10.5.10 Set style - setSeparatorType

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)

3.10.10.5.11 Get style - getSeparatorType

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

3.10.10.6 Standard Positioning and Sizing

3.10.10.6.1 Introduction

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

3.10.10.6.2 Set position constraints - setLocationConstraints

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.

3.10.10.6.3 Set size constraints - setSizeConstraints

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.

3.10.10.6.4 Set minimum height - setMinimumHeight

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).

3.10.10.6.5 Set minimum width - setMinimumWidth

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).

3.10.10.7 Overriden Superclass Methods

3.10.10.7.1 Introduction

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

3.10.10.7.2 Set background - setBackground

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.

3.10.10.7.3 Set background colours - setBackground

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.

3.10.10.7.4 Set foreground - setForeground

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.

3.10.10.7.5 Get minimum size - getMinimumSize

This method returns the minimum size of the component.

Method Definition:
public Dimension getMinimumSize()
Parameters List:
none

3.10.10.7.6 Get preferred size - getPreferredSize

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