public class DefaultLayoutControl extends JComponent implements LayoutControl
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static String |
PERSISTENCE_DEFINITION_NAME |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 |
|---|
DefaultLayoutControl()
Create a new object of LayoutControl.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addGeometryAdapterPoint()
Add a new point to geometryAdapter.
|
void |
addLayoutTool(String name,
LayoutBehavior tool)
Add a new Layout tool.
|
protected AffineTransform |
calculateTransformFromViewport()
Calculates the affine transform using the viewport and the control size,
instead of calculating it from
rect. as usual. |
void |
clearMouseImage()
Clear the image of pointer of mouse.
|
void |
delLastPoint()
Remove last point of geometryAdapter.
|
void |
fullRect()
It obtains the rect that is adjusted to the size of the window,
to see the full extent of layout.
|
AffineTransform |
getAT()
Returns the AffineTransform that is applying in the Layout.
|
JComponent |
getComponent() |
LayoutBehavior |
getCurrentLayoutTool()
Returns the current Layout tool.
|
String |
getCurrentTool()
Returns the name of the current selected tool on this Layout
|
Point |
getFirstPoint()
It returns the first click point of mouse.
|
GeometryAdapter |
getGeometryAdapter()
It returns the current GeometryAdapter.
|
BufferedImage |
getImage()
Returns the current image of Layout.
|
BufferedImage |
getImgRuler()
Returns the image with the ruler.
|
Point |
getLastPoint()
Returns the last click point of mouse.
|
LayoutContext |
getLayoutContext()
Returns the LayoutContext.
|
FLayoutDraw |
getLayoutDraw()
Returns the object to draw the Layout.
|
FLayoutFunctions |
getLayoutFunctions()
Returns the object of FLayoutFunctions.
|
FLayoutZooms |
getLayoutZooms()
Returns the object to make zooms.
|
Point |
getPointAnt()
Returns the previous click of mouse.
|
Point |
getPosition()
Returns the position adjusted point.
|
Rectangle2D.Double |
getRect()
Returns a copy of the rectangle that represents the size
and position of the layout sheet (in pixels), relative to
the containing LayoutControl.
|
Point |
getRectOrigin()
It returns the point that represents the northwest corner of the Layout.
|
Rectangle |
getReSel()
Returns the rectangle of selection.
|
void |
initialize(LayoutPanel layoutPanel) |
boolean |
isDrawingCancelled()
It returns true if the drawing has been canceled.
|
boolean |
isReSel()
It returns true if should draw the rectangle of selection and does the
selection.
|
protected void |
paintComponent(Graphics g)
paintComponent of Layout.
|
void |
refresh()
Refres the Layout.
|
void |
setCancelDrawing(boolean b)
It cancels the drawing if the parameter is true.
|
void |
setDefaultTool()
Changes the currently selected tool to the default tool
|
void |
setFirstPoint()
Inserts the first click point of mouse.
|
void |
setGeometryAdapter(GeometryAdapter adapter)
Inserts the geometryAdapter.
|
void |
setGeometryAdapterPoinPosition()
Change the position of mousemoved point of geometryAdapter.
|
void |
setIsReSel(boolean b)
Insert true if should draw the rectangle of selection and does the
selection.
|
void |
setLastPoint()
Inserts the last click point of mouse.
|
void |
setLayoutContext(LayoutContext lc)
Inserts the LayoutContext.
|
void |
setMapCursor(Image image)
Changes the pointer of the mouse by the image of parameter.
|
void |
setPointAnt()
Inserts the previous click point of mouse.
|
void |
setPosition(Point point2)
Insert the position point and calculate the new position if the grid is
actived.
|
void |
setRect(Rectangle2D r)
Sets the size and position of the layout sheet in screen coordinates
(pixels), relative to the LayoutControl.
|
void |
setTool(String toolName)
It establishes as selected to the tool from its name of identification.
|
void |
startEdit()
Start the vertex edition of graphics.
|
void |
stopEdit()
Stop the vertex edition of graphics.
|
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
void |
viewFull()
It does a full extent of the layers that contains the view of the
FFrameView selected.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setBackground, 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, updateUIadd, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, 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, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHeight, getWidth, repaintpublic static final String PERSISTENCE_DEFINITION_NAME
public DefaultLayoutControl()
layout - public void initialize(LayoutPanel layoutPanel)
public String getCurrentTool()
LayoutControlgetCurrentTool in interface LayoutControlpublic void addLayoutTool(String name, LayoutBehavior tool)
LayoutControladdLayoutTool in interface LayoutControlname - Name of tool.tool - LayoutBehaviorpublic void setLayoutContext(LayoutContext lc)
LayoutControlsetLayoutContext in interface LayoutControllc - LayoutContext.protected void paintComponent(Graphics g)
paintComponent in class JComponentg - Graphics of Layout.public BufferedImage getImgRuler()
LayoutControlgetImgRuler in interface LayoutControlpublic void fullRect()
LayoutControlfullRect in interface LayoutControlpublic Rectangle2D.Double getRect()
LayoutControlReturns a copy of the rectangle that represents the size and position of the layout sheet (in pixels), relative to the containing LayoutControl.
Note: you must use LayoutControl.setRect(Rectangle2D) to update
the rectangle, as this method only returns a copy of it.
getRect in interface LayoutControlLayoutControl.setRect(Rectangle2D)public void setRect(Rectangle2D r)
LayoutControlSets the size and position of the layout sheet in screen coordinates (pixels), relative to the LayoutControl.
The size of the sheet is usually different from the bounds of the underlying UI control, for instance if we have zoomed in an area of the sheet then the paper size in pixels will be bigger than the actual control size.
setRect in interface LayoutControlpublic BufferedImage getImage()
LayoutControlgetImage in interface LayoutControlpublic void setMapCursor(Image image)
LayoutControlsetMapCursor in interface LayoutControlimage - Imagepublic void setTool(String toolName)
LayoutControlsetTool in interface LayoutControltoolName - Name of identification tool.public void setDefaultTool()
LayoutControlsetDefaultTool in interface LayoutControlpublic void startEdit()
LayoutControlstartEdit in interface LayoutControlpublic void stopEdit()
LayoutControlstopEdit in interface LayoutControlpublic Point getRectOrigin()
LayoutControlgetRectOrigin in interface LayoutControlpublic FLayoutDraw getLayoutDraw()
LayoutControlgetLayoutDraw in interface LayoutControlpublic LayoutBehavior getCurrentLayoutTool()
LayoutControlgetCurrentLayoutTool in interface LayoutControlpublic Point getFirstPoint()
LayoutControlgetFirstPoint in interface LayoutControlpublic Point getPointAnt()
LayoutControlgetPointAnt in interface LayoutControlpublic Point getLastPoint()
LayoutControlgetLastPoint in interface LayoutControlpublic void setFirstPoint()
LayoutControlsetFirstPoint in interface LayoutControlpublic void setPointAnt()
LayoutControlsetPointAnt in interface LayoutControlpublic void setLastPoint()
LayoutControlsetLastPoint in interface LayoutControlpublic void setPosition(Point point2)
LayoutControlsetPosition in interface LayoutControlpoint2 - Position.public Point getPosition()
LayoutControlgetPosition in interface LayoutControlpublic AffineTransform getAT()
LayoutControlgetAT in interface LayoutControlpublic GeometryAdapter getGeometryAdapter()
LayoutControlgetGeometryAdapter in interface LayoutControlpublic void delLastPoint()
LayoutControldelLastPoint in interface LayoutControlpublic int addGeometryAdapterPoint()
LayoutControladdGeometryAdapterPoint in interface LayoutControlpublic void setGeometryAdapterPoinPosition()
LayoutControlsetGeometryAdapterPoinPosition in interface LayoutControlpublic void clearMouseImage()
LayoutControlclearMouseImage in interface LayoutControlpublic void refresh()
LayoutControlrefresh in interface LayoutControlprotected AffineTransform calculateTransformFromViewport()
rect. as usual. This is required when
the component size changes, as rect. has to be recalculated using
the viewport, and thus we can't calculate the affine transform using
rect.public boolean isDrawingCancelled()
LayoutControlisDrawingCancelled in interface LayoutControlpublic void setCancelDrawing(boolean b)
LayoutControlsetCancelDrawing in interface LayoutControlb - true if the drawing wants to be canceledpublic Rectangle getReSel()
LayoutControlgetReSel in interface LayoutControlpublic boolean isReSel()
LayoutControlisReSel in interface LayoutControlpublic void setIsReSel(boolean b)
LayoutControlsetIsReSel in interface LayoutControlb - boolean.public void viewFull()
throws ReadException
LayoutControlviewFull in interface LayoutControlReadExceptionpublic FLayoutZooms getLayoutZooms()
LayoutControlgetLayoutZooms in interface LayoutControlpublic FLayoutFunctions getLayoutFunctions()
LayoutControlgetLayoutFunctions in interface LayoutControlpublic LayoutContext getLayoutContext()
LayoutControlgetLayoutContext in interface LayoutControlpublic void setGeometryAdapter(GeometryAdapter adapter)
LayoutControlsetGeometryAdapter in interface LayoutControladapter - GeometryAdapter.public JComponent getComponent()
getComponent in interface LayoutControlpublic void update(Observable observable, Object notification)
ObserverObservable object is changed and this
Observer has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer and other Observers listening to the same
Observable.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver and prepare this method
implementation to handle receiving DefaultComplexNotification instances
as well as direct notification objects.