3.4.11 - Blank Object - JdlBlankObject

John W. Campbell

3.4.11.1 Introduction

This class provides a blank (infill) JdlView based window. This is basically just an empty area but it will be framed and coloured consistently with the other JdlView objects in a JdlView object based layout.

Class, fields, constructor and methods:

Class Details
Accessible Fields
Constructor
Standard Positioning and Sizing
Overriden Superclass Methods

3.4.11.2 Class Details

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

3.4.11.3 Accessible Fields

The following accessible fields have been defined:

public final static int PREFERRED
Size Constraint: preferred size.
public final static int FREE
Location Constraint: free
static final long serialVersionUID

3.4.11.4 Constructor

3.4.11.4.1 Introduction

A single constructor is available.

Constructor:

Standard constructor

3.4.11.4.2 Standard constructor

Constructs a JdlBlankObject with the initial required size.

Constructor Definition:
public JdlBlankObject(int w, int h, JdlViewOptions view_opts)
Parameters List:
w
Width required in pixels.
h
Height required in pixels.
view_opts
Object to set non-default options for borders, active strip, colours and fonts.

3.4.11.5 Standard Positioning and Sizing

3.4.11.5.1 Introduction

This section contains the standard methods for positioning JdlView objects and setting and getting the current minimum height and width values.

Methods:

Set position constraints - setLocationConstraints
Set size constraints - setSizeConstraints
Set minimum height - setMinimumHeight
Get minimum height - getMinimumHeight
Set minimum width - setMinimumWidth
Get minimum width - getMinimumWidth

3.4.11.5.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.4.11.5.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.4.11.5.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.4.11.5.5 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.4.11.5.6 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.4.11.5.7 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.4.11.6 Overriden Superclass Methods

3.4.11.6.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 foreground - setForeground
Get minimum size - getMinimumSize
Get preferred size - getPreferredSize

3.4.11.6.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.4.11.6.3 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.4.11.6.4 Get minimum size - getMinimumSize

This method returns the minimum size of the component.

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

3.4.11.6.5 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