JXTA

net.jxta.widget
Class Rule

java.lang.Object
  |
  +--java.awt.Component
        |
        +--net.jxta.widget.Rule

public class Rule
extends java.awt.Component

Draws a horizontal or vertical ruler, which may or may not take the entire part of its largest dimension. You can specify the amount taken in percent of the size of this component in its largest dimension. The ruler may be inside or outside embossed.

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Rule()
          Creates a new ruler with a thickness of 2, taking up all the space in its longest dimension and an inside embosement
Rule(int thickness, int ruleLength, boolean embossedIn)
          Creates a new ruler with the indicated thickness, length and embosement style
 
Method Summary
 java.awt.Dimension getMinimumSize()
          Returns the minimum dimension of this component, which is thickness in both dimensions.
 java.awt.Dimension getPreferredSize()
          Returns the preferred dimension of this component, which is thickness in both dimensions.
 void paint(java.awt.Graphics g)
          Paints this component
 void setRuleLength(int ruleLength)
          Changes the length of the ruler
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule()
Creates a new ruler with a thickness of 2, taking up all the space in its longest dimension and an inside embosement

Rule

public Rule(int thickness,
            int ruleLength,
            boolean embossedIn)
Creates a new ruler with the indicated thickness, length and embosement style
Parameters:
thickness - the thickness of the ruler
ruleLength - the length of the ruler in its longest dimension in percent
embossedIn - the embosement style of the ruler
Method Detail

setRuleLength

public void setRuleLength(int ruleLength)
Changes the length of the ruler
Parameters:
ruleLength - the length of the ruler in its longest dimension in percent

paint

public void paint(java.awt.Graphics g)
Paints this component
Overrides:
paint in class java.awt.Component
Parameters:
g - the Graphics context to which to draw this component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum dimension of this component, which is thickness in both dimensions.
Overrides:
getMinimumSize in class java.awt.Component
Returns:
the minimum dimension of this component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred dimension of this component, which is thickness in both dimensions.
Overrides:
getPreferredSize in class java.awt.Component
Returns:
the preferred dimension of this component

JXTA