3.2.6 - Active Strip - JdlActiveStrip

John W. Campbell

3.2.6.1 Introduction

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

3.2.6.2 Class Details

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

3.2.6.3 Accessible Fields

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

3.2.6.4 Constructor

3.2.6.4.1 Introduction

A single constructor is available.

Constructor:

Standard Constructor
Set active state - setActive
Reset focus state - setActiveFocus
Get active state - getActive

3.2.6.4.2 Standard Constructor

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

3.2.6.4.3 Set active state - setActive

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

3.2.6.4.4 Reset focus state - setActiveFocus

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

3.2.6.4.5 Get active state - getActive

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.

3.2.6.5 Standard Positioning and Sizing

3.2.6.5.1 Introduction

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

3.2.6.5.2 Set position constraints - setLocationConstraints

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.

3.2.6.5.3 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.2.6.5.4 Get minimum height - getMinimumHeight

Get the minimum height resource.

Method Definition:
public int getMinimumHeight()
Parameters List:
none
Method Return:
Returns the value of the minimum height resource.

3.2.6.5.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.2.6.5.6 Get minimum width - getMinimumWidth

Get the minimum width resource.

Method Definition:
public int getMinimumWidth()
Parameters List:
none
Method Return:
Returns the value of the minimum width resource.

3.2.6.5.7 Set size constraints - setSizeConstraints

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.

3.2.6.5.8 Get minimum size - getMinimumSize

Returns the required minimum size of the component.

Method Definition:
public Dimension getMinimumSize()
Parameters List:
none
Method Return:
The minimum size.

3.2.6.5.9 Get preferred size - getPreferredSize

Returns the preferred size of the component.

Method Definition:
public Dimension getPreferredSize()
Parameters List:
none
Method Return:
The preferred size.

3.2.6.5.10 Paints the component. - paintComponent

Method Definition:
public void paintComponent(Graphics g)
Parameters List:
none

⇑ Up 3   ⇑ Up 2   ⇑ Up 1   ⇑ Top of this