John W. Campbell
This class provides an active strip for JdlView objects implementing the
JdlViewObject interface. These will be displayed when the JdlView objects
are used in conjunction with the JdlViewManager object.
Class, fields, constructor and methods:
Class Details
Accessible Fields
Constructor
Standard Positioning and Sizing
- Package:
- Jdl.JdlView;
- Class name:
- JdlActiveStrip
- Class definition:
- public class JdlActiveStrip
- Extends:
- JPanel
- Implements:
- none
- Actions:
- none
The following accessible fields have been defined:
- public final static int FREE
- Location/Size Constraint: free.
- public final static int DEFAULT
- Size Constraint: default.
- public final static int NO_FOCUS
- Does not require keyboard focus.
- public final static int FOCUS_OFF
- Requires keyboard focus but focus is off.
- public final static int FOCUS_ON
- Requires keyboard focus and focus is on.
- static final long serialVersionUID
A single constructor is available.
Constructor:
Standard Constructor
Set active state - setActive
Reset focus state - setActiveFocus
Get active state - getActive
Constructs a JdlActiveStrip object with an initial string.
- Constructor Definition:
- public JdlActiveStrip ()
- Parameters List:
- act_msg
- An ititial active strip message string
- font
- The font for active strip messages
- act_colr
- The colour to indicate that view object is active
This method sets the JdlView object status and sets the active
strip message if required.
- Method Definition:
- public void setActive (boolean act, String msg, int focus)
- Parameters List:
- act
- True for active state on, otherwise false.
- msg
- The message string if the active state is on (otherwise ignored).
- focus
- The keyboard focus flag:
= 0, The object does not require keyboard focus - NO_FOCUS
= 1, The object requires the keyboard focus but does not have that
focus - FOCUS_OFF
= 2, The object requires the keyboard focus and has the focus -
FOCUS_ON
This method resets the keyboard focus state (without changing the active state)
- Method Definition:
- public void setActiveFocus (int focus)
- Parameters List:
- The
- keyboard focus flag:
= 0, The object no longer requires the keyboard focus - NO_FOCUS
= 1, The object requires the keyboard focus but does not have that
focus - FOCUS_OFF
= 2, The object requires the keyboard focus and has the focus -
FOCUS_ON
This method returns the current state (active on or off).
- Method Definition:
- public boolean getActive()
- Parameters List:
- none
- Method Return:
-
Returns true if active state set, otherwise false.
This section contains the standard methods for positioning and sizing
JdlView objects and getting the current minimum height and width values
and the required minimum and preferred sizes.
Methods:
Set position constraints - setLocationConstraints
Set minimum height - setMinimumHeight
Get minimum height - getMinimumHeight
Set minimum width - setMinimumWidth
Get minimum width - getMinimumWidth
Set size constraints - setSizeConstraints
Get minimum size - getMinimumSize
Get preferred size - getPreferredSize
Paints the component. - paintComponent
Set constraints on the JdlActiveStrip positioning.
- Method Definition:
- public void setLocationConstraints (int constraint_x, int constraint_y)
- Parameters List:
- constraint_x
- Constrain JdlActiveStrip 'x' position = the required
JdlActiveStrip '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 JdlActiveStrip 'y' position = the required
JdlActiveStrip '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 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).
Get the minimum height resource.
- Method Definition:
- public int getMinimumHeight()
- Parameters List:
- none
- Method Return:
-
Returns the value of the minimum height resource.
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).
Get the minimum width resource.
- Method Definition:
- public int getMinimumWidth()
- Parameters List:
- none
- Method Return:
-
Returns the value of the minimum width resource.
Set constraints on the active strip size.
- Method Definition:
- public void setSizeConstraints (int constraint_w, int constraint_h)
- Parameters List:
- constraint_w
- Constrain strip width = the required strip width,
or DEFAULT if the preferred width is to be used, or FREE if the width may
be resized to anything greater than the minimum width.
- constraint_h
- Constrain strip height = the required strip height,
or DEFAULT if the preferred height is to be used, or FREE if the height may
be resized to anything greater than the minimum height.
Returns the required minimum size of the component.
- Method Definition:
- public Dimension getMinimumSize()
- Parameters List:
- none
- Method Return:
-
The minimum size.
Returns the preferred size of the component.
- Method Definition:
- public Dimension getPreferredSize()
- Parameters List:
- none
- Method Return:
-
The preferred size.
- Method Definition:
- public void paintComponent(Graphics g)
- Parameters List:
- none
⇑ Up 3
⇑ Up 2
⇑ Up 1
⇑ Top of this