jlink.flowchart
Class JLPage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by jlink.flowchart.JLPage
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
JLFlowchart, JLWorksheet

public class JLPage
extends javax.swing.JLayeredPane

Creates a page-like background that enables WYSIWYG (What You See Is What You Get) editing and display of flowchart components. This provides basic functionality for all other types of containers to build on and add increasingly more complex rules to.

Author:
jasonkb
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean bgTransparency
          Deprecated. Use PAGE_TRANSPARENT and setJLPageType(int type) instead.
protected  boolean bordersOn
          JLPage property that holds information about if the page will have borders around it or not.
protected  int bottomMargin
          Bottom margin for this JLPage.
protected  java.awt.Color containerBackgroundColor
          JLPage property with information about the color of the background.
protected  java.awt.Color containerBorderColor
          JLPage property that holds information about the border color.
protected  java.awt.Color containerShadowColor
          JLPage property with information about the color of the shadows.
static float CONVERT_CM_IN
          Converts centimetre to inch.
static float CONVERT_IN_CM
          Converts inch to centimetre.
inValue*JLPage.CONVERT_IN_CM = cmValue
protected  int currentOrientation
          The orientation property of JLPage.
protected  int h
          JLPage height property in pixels.
protected  int leftMargin
          Left margin for this JLPage.
protected  boolean marginsOn
          Margins property of JLPage.
static int ORIENTATION_LANDSCAPE
          Integer constant to specify an orientation of JLPage such that the width is larger than the height.
static int ORIENTATION_PORTRAIT
          Integer constant to specify an orientation of JLPage such that the width is smaller than the height.
static int ORIENTATION_SQUARE
          Integer constant to specify an orientation of JLPage such that the width is equal to the height.
static int PAGE_A4
          Integer constant to specify a page type of A4.
static int PAGE_PAPER
          Integer constant indicating a JLPage of paper type.
static int PAGE_PLAIN
          Integer constant indicating a JLPage of pail type.
static int PAGE_TRANSPARENT
          A transparent JLPage that has no background, borders, or shadows.
protected  int pageType
          The current page type of this JLPage.
protected  int rightMargin
          Right margin for this JLPage.
static int SCREEN_HEIGHT
          An integer constant that is the height of the screen in its value.
static int SCREEN_RESOLUTION
          An integer constant that is the resolution of the screen in its value.
static int SCREEN_WIDTH
          An integer constant that is the width of the screen in its value.
protected  boolean shadowsOn
          JLPage property with information about if shadows are on.
protected  int topMargin
          Top margin for this JLPage.
static int UNIT_CM
          Integer constant to clarify what type of units are being used.
static int UNIT_INCH
          Integer constant to clarify what type of units are being used.
static int UNIT_PIXEL
          Integer constant to clarify what type of units are being used.
protected  int w
          JLPage width property in pixels.
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JLPage()
          Creates a new instance of JLPage
 
Method Summary
 float convertCM_TO_INCH(float cm)
          Converts centimetres to inches.
 int convertCM_TO_PIXEL(float cm)
          Converts centimetres to an on-screen equivalent in pixels (so that the size is equal in life and screen).
 float convertINCH_TO_CM(float inch)
          Converts inches to centimetres.
 int convertINCH_TO_PIXEL(float inch)
          Converts inches to an on-screen equivalent in pixels (so that the size is equal in life and screen).
 float convertPIXEL_TO_CM(int pixel)
          Converts a pixel distance on-screen to a physical size in centimertres.
 float convertPIXEL_TO_INCH(int pixel)
          Converts a pixel distance on-screen to a physical size in inches.
 java.awt.Color getBackground()
          Returns the background color of this JLPage.
 java.awt.Color getJLPageBorderColor()
          Gets the color of the borders around JLPage.
 float getJLPageCmHeight()
          The height of this JLPage in centimetres.
 float getJLPageCmWidth()
           
 int getJLPageHeight()
          Get the height of this JLPage.
 float getJLPageInchHeight()
          The height of this JLPage in inches.
 float getJLPageInchWidth()
           
 int getJLPageOrientation()
          Test to determine the orientation of JLPage.
 java.awt.Color getJLPageShadowColor()
          Gets the color of the shadows of JLPage.
 java.awt.Dimension getJLPageSize()
          Get the size of this JLPage as a Dimension.
 java.awt.Dimension getJLPageSize(int unitType)
          Get the size of this JLPage as a Dimension.
 int getJLPageType()
          Gives information about the type of page that this JLPage is representing.
 int getJLPageWidth()
          Get the width of this JLPage in pixels.
 int[] getMargins()
          Returns the margins of this JLPage as an array.
 java.lang.String getUIClassID()
          Returns the UI string for JLPage which is PageUI.UI_CLASS_ID
 boolean isBackgroundTransparent()
          Deprecated. Use getJLPageType() to test if the JLPage is transparent.
 boolean isBordersOn()
          Boolean test to see if the JLPage is using borders.
 boolean isFocusable()
          JLPage is always a focusable component.
 boolean isMarginsOn()
          Tests if the margins are on and being used in this JLPage.
 boolean isShadowsOn()
          Tests if the shadows are on and being used by JLPage.
 void setBackground(java.awt.Color c)
          Sets the background color of this JLPage.
 void setBordersOn(boolean value)
          Turns JLPage borders either on or off depending on the parameters.
 void setBottomMargin(int value)
          Individually sets the bottom margin of this JLPage.
 void setJLPageBorderColor(java.awt.Color c)
          Sets the border color of the JLPage.
 void setJLPageHeight(int height)
          Sets the height alone of this JLPage in pixels.
 void setJLPageOrientation(int orientation)
          Sets the orientation of this JLPage to be one of two integer constants: ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE.
 void setJLPageShadowColor(java.awt.Color c)
          Sets the color of the shadows of JLPage.
 void setJLPageSize(java.awt.Dimension d)
          Sets the size of this JLPage.
 void setJLPageSize(java.awt.Dimension d, int unitType)
          Sets the size of this JLPage.
 void setJLPageSize(int width, int height)
          Set the size of this JLPage.
 void setJLPageType(int type)
          Set the JLPage to a type of page.
 void setJLPageWidth(int width)
          Sets the width alone of this JLPage in pixels.
 void setLeftMargin(int value)
          Individually sets the left margin of this JLPage.
 void setMargins(int top, int left, int bottom, int right)
          Sets the margins of the JLPage.
 void setMarginsOn(boolean value)
          Either turns on or off the usage of margins in the JLPage.
 void setRightMargin(int value)
          Individually sets the right margin of this JLPage.
 void setShadowsOn(boolean value)
          Turns shadows either on or off in this JLPage.
 void setSize(java.awt.Dimension d)
          Sets the size of this JLPage by calling the setJLPageSize(Dimension d) method.
 void setSize(int width, int height)
          Set the size of this JLPage by calling setJLPageSize(int width, int height)
 void setTopMargin(int value)
          Individually sets the top margin of this JLPage.
 void setUI(JLPageUI ui)
          Sets the UI of this JLPage.
 void turnOffBackgroundTransparency()
          Deprecated. Use setJLPageType(int type) instead. Stability not certain.
 void turnOffBorders()
          Turns off the borders for JLPage.
 void turnOffMargins()
          Turns off the usage of margins in the JLPage.
 void turnOffShadows()
          Turns off shadows in this JLPage.
 void turnOnBackgroundTransparency()
          Deprecated. Use setJLPageType(int type) instead. Stability not certain.
 void turnOnBorders()
          Turns on the borders for JLPage.
 void turnOnMargins()
          Turns on the usage of margins in the JLPage.
 void turnOnShadows()
          Turns on shadows in this JLPage.
 void updateUI()
           
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PAGE_A4

public static final int PAGE_A4
Integer constant to specify a page type of A4. A4 pages are 21cm X 29.7cm in size.

By using this constant in setting the page type, the appropriate number of pixels will be used so as to create the same size image on screen. There will also be a border and a shadow so as to appear like paper on the monitor.

See Also:
setJLPageType(int type), Constant Field Values

PAGE_PAPER

public static final int PAGE_PAPER
Integer constant indicating a JLPage of paper type. These may have arbitrary sizes, but will possess shadows on screen to simulate paper.

See Also:
setJLPageType(int type), Constant Field Values

PAGE_PLAIN

public static final int PAGE_PLAIN
Integer constant indicating a JLPage of pail type. These may have arbitrary sizes, but do not have shadows like paper types or A4 types to simulate paper, hence being plain.

See Also:
setJLPageType(int type), Constant Field Values

PAGE_TRANSPARENT

public static final int PAGE_TRANSPARENT
A transparent JLPage that has no background, borders, or shadows.

See Also:
setJLPageType(int type), Constant Field Values

pageType

protected int pageType
The current page type of this JLPage.

See Also:
setJLPageType(int type)

marginsOn

protected boolean marginsOn
Margins property of JLPage. true if margins are being used, false if not.

Margins help prevent components from falling outside the boundaries of the JLPage.

See Also:
setMargins(int top, int left, int bottom, int right)

topMargin

protected int topMargin
Top margin for this JLPage. Default value is 0

See Also:
setTopMargin(int value)

leftMargin

protected int leftMargin
Left margin for this JLPage. Default value is 0

See Also:
setLeftMargin(int value)

bottomMargin

protected int bottomMargin
Bottom margin for this JLPage. Default value is 0

See Also:
setBottomMargin(int value)

rightMargin

protected int rightMargin
Right margin for this JLPage. Default value is 0

See Also:
setRightMargin(int value)

bordersOn

protected boolean bordersOn
JLPage property that holds information about if the page will have borders around it or not.

See Also:
setBordersOn(boolean value)

containerBorderColor

protected java.awt.Color containerBorderColor
JLPage property that holds information about the border color.

See Also:
setJLPageBorderColor(Color c)

shadowsOn

protected boolean shadowsOn
JLPage property with information about if shadows are on.


containerShadowColor

protected java.awt.Color containerShadowColor
JLPage property with information about the color of the shadows.


containerBackgroundColor

protected java.awt.Color containerBackgroundColor
JLPage property with information about the color of the background.


bgTransparency

protected boolean bgTransparency
Deprecated. Use PAGE_TRANSPARENT and setJLPageType(int type) instead.
JLPage property with information about the transparency status of the background. The default value is false meaning that the background is not transparent.


w

protected int w
JLPage width property in pixels. Default of 200.


h

protected int h
JLPage height property in pixels. Default of 200.


SCREEN_WIDTH

public static final int SCREEN_WIDTH
An integer constant that is the width of the screen in its value. This is determined from runtime of JLink and upon creation of an instance of this class.


SCREEN_HEIGHT

public static final int SCREEN_HEIGHT
An integer constant that is the height of the screen in its value. This is determined from runtime of JLink and upon creation of an instance of this class.


SCREEN_RESOLUTION

public static final int SCREEN_RESOLUTION
An integer constant that is the resolution of the screen in its value. This is determined from runtime of JLink and upon creation of an instance of this class. The resolution is given in the form of pixels per inch.


CONVERT_CM_IN

public static final float CONVERT_CM_IN
Converts centimetre to inch.
cmValue*JLPage.CONVERT_CM_IN = inValue

See Also:
Constant Field Values

CONVERT_IN_CM

public static final float CONVERT_IN_CM
Converts inch to centimetre.
inValue*JLPage.CONVERT_IN_CM = cmValue

See Also:
Constant Field Values

UNIT_INCH

public static final int UNIT_INCH
Integer constant to clarify what type of units are being used. JLPage can determine how many pixels to draw on screen to create an on screen inch equivalent.

See Also:
UNIT_CM, UNIT_PIXEL, Constant Field Values

UNIT_CM

public static final int UNIT_CM
Integer constant to clarify what type of units are being used. JLPage can determine how many pixels to draw on screen to create an on screen centimetre equivalent.

See Also:
UNIT_INCH, UNIT_PIXEL, Constant Field Values

UNIT_PIXEL

public static final int UNIT_PIXEL
Integer constant to clarify what type of units are being used. JLPage can determine that the units it is being given are pixels and not some other unit, in which case it will set distance based on pixels and not inches or centimetres.

See Also:
UNIT_CM, UNIT_INCH, Constant Field Values

ORIENTATION_PORTRAIT

public static final int ORIENTATION_PORTRAIT
Integer constant to specify an orientation of JLPage such that the width is smaller than the height.

See Also:
ORIENTATION_LANDSCAPE, ORIENTATION_SQUARE, setJLPageOrientation(int orientation), Constant Field Values

ORIENTATION_LANDSCAPE

public static final int ORIENTATION_LANDSCAPE
Integer constant to specify an orientation of JLPage such that the width is larger than the height.

See Also:
ORIENTATION_PORTRAIT, ORIENTATION_SQUARE, setJLPageOrientation(int orientation), Constant Field Values

ORIENTATION_SQUARE

public static final int ORIENTATION_SQUARE
Integer constant to specify an orientation of JLPage such that the width is equal to the height.

See Also:
ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, setJLPageOrientation(int orientation), Constant Field Values

currentOrientation

protected int currentOrientation
The orientation property of JLPage.

See Also:
setJLPageOrientation(int orientation)
Constructor Detail

JLPage

public JLPage()
Creates a new instance of JLPage

See Also:
JLPage
Method Detail

convertCM_TO_INCH

public float convertCM_TO_INCH(float cm)
Converts centimetres to inches.

Parameters:
cm - The value in centimetres.
Returns:
The value in inches.

convertINCH_TO_CM

public float convertINCH_TO_CM(float inch)
Converts inches to centimetres.

Parameters:
inch - The value in inches.
Returns:
The value in centimetres.

convertCM_TO_PIXEL

public int convertCM_TO_PIXEL(float cm)
Converts centimetres to an on-screen equivalent in pixels (so that the size is equal in life and screen).

Parameters:
cm - The value in centimetres.
Returns:
The pixel equivalent.

convertINCH_TO_PIXEL

public int convertINCH_TO_PIXEL(float inch)
Converts inches to an on-screen equivalent in pixels (so that the size is equal in life and screen).

Parameters:
inch - The value in inches.
Returns:
The pixel equivalent.

convertPIXEL_TO_INCH

public float convertPIXEL_TO_INCH(int pixel)
Converts a pixel distance on-screen to a physical size in inches.

Parameters:
pixel - The pixel length.
Returns:
The equivalent size in inches.

convertPIXEL_TO_CM

public float convertPIXEL_TO_CM(int pixel)
Converts a pixel distance on-screen to a physical size in centimertres.

Parameters:
pixel - The pixel length.
Returns:
The equivalent size in centimetres.

setUI

public void setUI(JLPageUI ui)
Sets the UI of this JLPage. This takes a JLPageUI as input (a standard implementation of a page, that other more advanced page formats can emulate).

Parameters:
ui - The UI to set for this JLPage.

updateUI

public void updateUI()
Overrides:
updateUI in class javax.swing.JComponent

getUIClassID

public java.lang.String getUIClassID()
Returns the UI string for JLPage which is PageUI.UI_CLASS_ID

Overrides:
getUIClassID in class javax.swing.JComponent
Returns:
The string with information about this UI class ID.

turnOnBackgroundTransparency

public void turnOnBackgroundTransparency()
Deprecated. Use setJLPageType(int type) instead. Stability not certain.

Turns on background transparency.


turnOffBackgroundTransparency

public void turnOffBackgroundTransparency()
Deprecated. Use setJLPageType(int type) instead. Stability not certain.

Turns off background transparency.


isBackgroundTransparent

public boolean isBackgroundTransparent()
Deprecated. Use getJLPageType() to test if the JLPage is transparent.

Returns:
The status of transparency of this JLPage.

isFocusable

public boolean isFocusable()
JLPage is always a focusable component.

Overrides:
isFocusable in class java.awt.Component
Returns:
Always true

setSize

public void setSize(int width,
                    int height)
Set the size of this JLPage by calling setJLPageSize(int width, int height)

Overrides:
setSize in class java.awt.Component
Parameters:
width - The width to set.
height - The height to set.

setJLPageSize

public void setJLPageSize(int width,
                          int height)
Set the size of this JLPage.

Parameters:
width - The width to set.
height - The height to set.

setSize

public void setSize(java.awt.Dimension d)
Sets the size of this JLPage by calling the setJLPageSize(Dimension d) method.

Overrides:
setSize in class java.awt.Component
Parameters:
d - The size to set this JLPage to be.

setJLPageSize

public void setJLPageSize(java.awt.Dimension d)
Sets the size of this JLPage.

Parameters:
d - Dimension with pixels as the units inside.

setJLPageSize

public void setJLPageSize(java.awt.Dimension d,
                          int unitType)
Sets the size of this JLPage.

Parameters:
d - The size to set this JLPage.
unitType -
See Also:
setJLPageSize(int width, int height)

getJLPageSize

public java.awt.Dimension getJLPageSize(int unitType)
Get the size of this JLPage as a Dimension.

Parameters:
unitType - The desired units that this function should return. If set to UNIT_CM will return the size of this JLPage as a Dimension with centimetres in the width and height values as opposed to pixels.
Returns:
The size of this JLPage in the specified units.

getJLPageSize

public java.awt.Dimension getJLPageSize()
Get the size of this JLPage as a Dimension.

Returns:
The size of this JLPage in the Dimension as pixels.

getJLPageWidth

public int getJLPageWidth()
Get the width of this JLPage in pixels.

Returns:
The width of this JLPage in pixels.

getJLPageCmWidth

public float getJLPageCmWidth()

getJLPageInchWidth

public float getJLPageInchWidth()

setJLPageWidth

public void setJLPageWidth(int width)
Sets the width alone of this JLPage in pixels.

Parameters:
width - The width to set.
See Also:
getJLPageWidth()

getJLPageHeight

public int getJLPageHeight()
Get the height of this JLPage.

Returns:
The height of this JLPage in pixels.

getJLPageCmHeight

public float getJLPageCmHeight()
The height of this JLPage in centimetres.

Returns:
Centimetres of height.

getJLPageInchHeight

public float getJLPageInchHeight()
The height of this JLPage in inches.

Returns:
Inches of height.

setJLPageHeight

public void setJLPageHeight(int height)
Sets the height alone of this JLPage in pixels.

Parameters:
height - The height to set.
See Also:
getJLPageHeight()

setJLPageType

public void setJLPageType(int type)
Set the JLPage to a type of page.

There are numerous types of page that can be set and displayed. These determine how JLPage is drawn. For instance:

Parameters:
type - The integer constant to set this JLPage to.

getJLPageType

public int getJLPageType()
Gives information about the type of page that this JLPage is representing.

There are numerous types of page that can be set and displayed. These determine how JLPage is drawn. For instance:

This method returns an integer constant (as mentioned above) depending on the current page type of JLPage.

Returns:
The current page type of JLPage.

setJLPageOrientation

public void setJLPageOrientation(int orientation)
Sets the orientation of this JLPage to be one of two integer constants: ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE.

If the current container size is square, this method returns without doing anything, otherwise, the container and its physical size will be molded to

Parameters:
orientation - Either ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE.

getJLPageOrientation

public int getJLPageOrientation()
Test to determine the orientation of JLPage.

This method will do the following:

If an error is encountered a -1 is returned.

Returns:
An integer constant describing the orientation of JLPage or if an error is encountered a -1 is returned.

setBackground

public void setBackground(java.awt.Color c)
Sets the background color of this JLPage.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
c - The color to set as the background of this JLPage.

getBackground

public java.awt.Color getBackground()
Returns the background color of this JLPage.

The background color is the color of the actual page itself (ie. what the components are added to.

Overrides:
getBackground in class java.awt.Component
Returns:
The background color of JLPage.

setJLPageBorderColor

public void setJLPageBorderColor(java.awt.Color c)
Sets the border color of the JLPage.

Parameters:
c - The color to set the borders.

getJLPageBorderColor

public java.awt.Color getJLPageBorderColor()
Gets the color of the borders around JLPage. This value defaults as black.

Returns:
The border color of JLPage.

turnOnBorders

public void turnOnBorders()
Turns on the borders for JLPage.


turnOffBorders

public void turnOffBorders()
Turns off the borders for JLPage.


setBordersOn

public void setBordersOn(boolean value)
Turns JLPage borders either on or off depending on the parameters.

Parameters:
value - If true turns on borders. If false turns off borders.

isBordersOn

public boolean isBordersOn()
Boolean test to see if the JLPage is using borders.

Returns:
true if using borders, false if not using borders.

setJLPageShadowColor

public void setJLPageShadowColor(java.awt.Color c)
Sets the color of the shadows of JLPage. This value defaults as black.

Parameters:
c - The color to set the shadows to.

getJLPageShadowColor

public java.awt.Color getJLPageShadowColor()
Gets the color of the shadows of JLPage. This value defaults as black.

Returns:
The shadow color.

turnOnShadows

public void turnOnShadows()
Turns on shadows in this JLPage.

Shadows hang behind the JLPage to make it look as though it were a real paper page on screen.


turnOffShadows

public void turnOffShadows()
Turns off shadows in this JLPage.

Shadows hang behind the JLPage to make it look as though it were a real paper page on screen.


setShadowsOn

public void setShadowsOn(boolean value)
Turns shadows either on or off in this JLPage.

Shadows hang behind the JLPage to make it look as though it were a real paper page on screen.

Parameters:
value - true turns on shadows, false turns off shadows.

isShadowsOn

public boolean isShadowsOn()
Tests if the shadows are on and being used by JLPage.

Shadows hang behind the JLPage to make it look as though it were a real paper page on screen.

Returns:
true if the shadows are on and false if they are off.

turnOnMargins

public void turnOnMargins()
Turns on the usage of margins in the JLPage.

Margins are used to stop components from being dragged off the JLPage.


turnOffMargins

public void turnOffMargins()
Turns off the usage of margins in the JLPage.

Margins are used to stop components from being dragged off the JLPage.


setMarginsOn

public void setMarginsOn(boolean value)
Either turns on or off the usage of margins in the JLPage.

Margins are used to stop components from being dragged off the JLPage.

Parameters:
value - Turns margins on if true and off if false.

isMarginsOn

public boolean isMarginsOn()
Tests if the margins are on and being used in this JLPage.

Margins are used to stop components from being dragged off the side of the page.

Returns:
true if the margins are on and false if they are off.

setTopMargin

public void setTopMargin(int value)
Individually sets the top margin of this JLPage.

Parameters:
value - The value to set the top margin to.

setLeftMargin

public void setLeftMargin(int value)
Individually sets the left margin of this JLPage.

Parameters:
value - The value to set the left margin to.

setBottomMargin

public void setBottomMargin(int value)
Individually sets the bottom margin of this JLPage.

Parameters:
value - The value to set the bottom margin to.

setRightMargin

public void setRightMargin(int value)
Individually sets the right margin of this JLPage.

Parameters:
value - The value to set the right margin to.

setMargins

public void setMargins(int top,
                       int left,
                       int bottom,
                       int right)
Sets the margins of the JLPage.

Parameters:
top - The top margin of this JLPage.
left - The left margin of this JLPage.
bottom - The bottom margin of this JLPage.
right - The right margin of this JLPage.

getMargins

public int[] getMargins()
Returns the margins of this JLPage as an array.

Returns:
An array of the form int[] margins = {this.topMargin, this.leftMargin, this.bottomMargin, this.rightMargin}