geofasc.swing
public class Rectangle extends AbstractFigure
Rectangle is the component used for visualizing a rectangle
figure. See RectangleModel for more information on how a rectangle
figure is represented. This class is inherited from AbstractFigure.DefaultRectangleModel,
RectangleUI,
BasicRectangleUI,
Serialized FormJComponent.AccessibleJComponentComponent.BaselineResizeBehaviorTOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Rectangle()
Constructs a new empty
Rectangle with width and height equal
to 0. |
Rectangle(int width,
int height)
Constructs a new
Rectangle with the given size. |
Rectangle(int x,
int y,
int width,
int height)
Constructs a new
Rectangle with the given bounds (size and
location). |
| Modifier and Type | Method and Description |
|---|---|
int |
getArcHeight()
|
Dimension |
getArcSize()
|
int |
getArcWidth()
|
RectangleModel |
getModel()
Returns the data model of this figure.
|
RectangleUI |
getUI() |
String |
getUIClassID() |
boolean |
hasRoundedCorners()
|
void |
moveFigureHeightBy(int dHeight)
|
void |
moveFigureSizeBy(Dimension dSize)
|
void |
moveFigureSizeBy(int dWidth,
int dHeight)
|
void |
moveFigureWidthBy(int dWidth)
|
void |
setArcHeight(int arcHeight)
|
void |
setArcSize(Dimension d)
|
void |
setArcSize(int arcWidth,
int arcHeight)
|
void |
setArcWidth(int arcWidth)
|
void |
setFigureBounds(int x,
int y,
int width,
int height)
|
void |
setFigureBounds(Rectangle bounds)
|
void |
setFigureHeight(int height)
|
void |
setFigureSize(Dimension size)
|
void |
setFigureSize(int width,
int height)
|
void |
setFigureWidth(int width)
|
void |
setModel(RectangleModel model)
Sets the model of this rectangle.
|
void |
setRoundedCorners(boolean roundRect)
|
void |
setUI(RectangleUI ui)
Sets the look and feel (L&F) object that renders this rectangle.
|
void |
updateUI() |
componentAdded, componentRemoved, getFigureBounds, getFigureBounds, getFigureDirection, getFigureFillColor, getFigureHeight, getFigureLineColor, getFigureLocation, getFigureLocationX, getFigureLocationY, getFigureSize, getFigureWidth, getMinimumSize, getPreferredSize, isFigureFilled, isSelfContainerListener, moveFigureLocationBy, moveFigureLocationBy, moveFigureLocationBy, moveFigureLocationXBy, moveFigureLocationYBy, setFigureDirection, setFigureFillColor, setFigureFilled, setFigureLineColor, setFigureLocation, setFigureLocation, setFigureLocationX, setFigureLocationY, setMaximumSize, setModel, setSelfContainerListener, setUI, stateChanged, turnFigureDirectionBy, turnFigureDirectionTogetAccessibleContext, setUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, 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, isFocusable, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Rectangle()
Rectangle with width and height equal
to 0.public Rectangle(int width,
int height)
Rectangle with the given size.width - the initial width of this rectangleheight - the initial height of this rectanglepublic Rectangle(int x,
int y,
int width,
int height)
Rectangle with the given bounds (size and
location).x - the initial x-location of this rectangley - the initial y-location of this rectanglewidth - the initial width of this rectangleheight - the initial height of this rectanglepublic RectangleModel getModel()
getModel in class AbstractFigureFigureModelpublic RectangleUI getUI()
getUI in class AbstractFigurepublic String getUIClassID()
getUIClassID in class AbstractFigurepublic void setModel(RectangleModel model)
model - the new model of this rectanglepublic void setUI(RectangleUI ui)
ui - the new L&F objectpublic void updateUI()
updateUI in class AbstractFigurepublic int getArcHeight()
public Dimension getArcSize()
public int getArcWidth()
public boolean hasRoundedCorners()
public void moveFigureHeightBy(int dHeight)
public void moveFigureSizeBy(Dimension dSize)
public void moveFigureSizeBy(int dWidth,
int dHeight)
public void moveFigureWidthBy(int dWidth)
public void setFigureBounds(int x,
int y,
int width,
int height)
public void setFigureBounds(Rectangle bounds)
public void setFigureHeight(int height)
public void setFigureSize(Dimension size)
public void setFigureSize(int width,
int height)
public void setFigureWidth(int width)
public void setArcHeight(int arcHeight)
public void setArcSize(Dimension d)
public void setArcSize(int arcWidth,
int arcHeight)
public void setArcWidth(int arcWidth)
public void setRoundedCorners(boolean roundRect)