Class DefaultLayoutControl
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.gvsig.app.project.documents.layout.DefaultLayoutControl
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,LayoutControl,org.gvsig.tools.observer.Observer
Control of Layout.
- Author:
- Vicente Caballero Navarro
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAdd a new point to geometryAdapter.voidaddLayoutTool(String name, LayoutBehavior tool) Add a new Layout tool.protected AffineTransformCalculates the affine transform using the viewport and the control size, instead of calculating it fromrect. as usual.voidClear the image of pointer of mouse.voidRemove last point of geometryAdapter.voidfullRect()It obtains the rect that is adjusted to the size of the window, to see the full extent of layout.getAT()Returns the AffineTransform that is applying in the Layout.Returns the current Layout tool.Returns the name of the current selected tool on this LayoutIt returns the first click point of mouse.It returns the current GeometryAdapter.getImage()Returns the current image of Layout.Returns the image with the ruler.Returns the last click point of mouse.Returns the LayoutContext.Returns the object to draw the Layout.Returns the object of FLayoutFunctions.getLayoutTool(String name) Returns the object to make zooms.Returns the previous click of mouse.Returns the position adjusted point.getRect()Returns a copy of the rectangle that represents the size and position of the layout sheet (in pixels), relative to the containing LayoutControl.It returns the point that represents the northwest corner of the Layout.getReSel()Returns the rectangle of selection.voidinitialize(LayoutPanel layoutPanel) booleanIt returns true if the drawing has been canceled.booleanisReSel()It returns true if should draw the rectangle of selection and does the selection.protected voidpaintComponent of Layout.voidrefresh()Refres the Layout.voidsetCancelDrawing(boolean b) It cancels the drawing if the parameter is true.voidChanges the currently selected tool to the default toolvoidInserts the first click point of mouse.voidsetGeometryAdapter(GeometryAdapter adapter) Inserts the geometryAdapter.voidChange the position of mousemoved point of geometryAdapter.voidsetIsReSel(boolean b) Insert true if should draw the rectangle of selection and does the selection.voidInserts the last click point of mouse.voidInserts the LayoutContext.voidsetMapCursor(Image image) Changes the pointer of the mouse by the image of parameter.voidInserts the previous click point of mouse.voidsetPosition(Point point2) Insert the position point and calculate the new position if the grid is actived.voidSets the size and position of the layout sheet in screen coordinates (pixels), relative to the LayoutControl.voidIt establishes as selected to the tool from its name of identification.voidStart the vertex edition of graphics.voidstopEdit()Stop the vertex edition of graphics.voidvoidviewFull()It does a full extent of the layers that contains the view of the FFrameView selected.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, getUI, 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, updateUIMethods inherited from class java.awt.Container
add, 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, validateTreeMethods 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, getAccessibleContext, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gvsig.app.project.documents.layout.LayoutControl
getHeight, getWidth, repaint
-
Field Details
-
PERSISTENCE_DEFINITION_NAME
- See Also:
-
-
Constructor Details
-
DefaultLayoutControl
public DefaultLayoutControl()Create a new object of LayoutControl.- Parameters:
layout-
-
-
Method Details
-
initialize
-
getCurrentTool
Description copied from interface:LayoutControlReturns the name of the current selected tool on this Layout- Specified by:
getCurrentToolin interfaceLayoutControl- Returns:
- A tool name.
-
addLayoutTool
Description copied from interface:LayoutControlAdd a new Layout tool.- Specified by:
addLayoutToolin interfaceLayoutControl- Parameters:
name- Name of tool.tool- LayoutBehavior
-
getLayoutTool
- Specified by:
getLayoutToolin interfaceLayoutControl
-
setLayoutContext
Description copied from interface:LayoutControlInserts the LayoutContext.- Specified by:
setLayoutContextin interfaceLayoutControl- Parameters:
lc- LayoutContext.
-
paintComponent
paintComponent of Layout.- Overrides:
paintComponentin classJComponent- Parameters:
g- Graphics of Layout.
-
getImgRuler
Description copied from interface:LayoutControlReturns the image with the ruler.- Specified by:
getImgRulerin interfaceLayoutControl- Returns:
- Ruler image.
-
fullRect
public void fullRect()Description copied from interface:LayoutControlIt obtains the rect that is adjusted to the size of the window, to see the full extent of layout.- Specified by:
fullRectin interfaceLayoutControl
-
getRect
Description copied from interface: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.- Specified by:
getRectin interfaceLayoutControl- Returns:
- Rectangle2D.Double Rectangle that represents the sheet.
- See Also:
-
setRect
Description copied from interface: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.
- Specified by:
setRectin interfaceLayoutControl
-
getImage
Description copied from interface:LayoutControlReturns the current image of Layout.- Specified by:
getImagein interfaceLayoutControl- Returns:
- Current image of Layout.
-
setMapCursor
Description copied from interface:LayoutControlChanges the pointer of the mouse by the image of parameter.- Specified by:
setMapCursorin interfaceLayoutControl- Parameters:
image- Image
-
setTool
Description copied from interface:LayoutControlIt establishes as selected to the tool from its name of identification.- Specified by:
setToolin interfaceLayoutControl- Parameters:
toolName- Name of identification tool.
-
setDefaultTool
public void setDefaultTool()Description copied from interface:LayoutControlChanges the currently selected tool to the default tool- Specified by:
setDefaultToolin interfaceLayoutControl
-
startEdit
public void startEdit()Description copied from interface:LayoutControlStart the vertex edition of graphics.- Specified by:
startEditin interfaceLayoutControl
-
stopEdit
public void stopEdit()Description copied from interface:LayoutControlStop the vertex edition of graphics.- Specified by:
stopEditin interfaceLayoutControl
-
getRectOrigin
Description copied from interface:LayoutControlIt returns the point that represents the northwest corner of the Layout.- Specified by:
getRectOriginin interfaceLayoutControl- Returns:
- Point.
-
getLayoutDraw
Description copied from interface:LayoutControlReturns the object to draw the Layout.- Specified by:
getLayoutDrawin interfaceLayoutControl- Returns:
- FLayoutDraw.
-
getCurrentLayoutTool
Description copied from interface:LayoutControlReturns the current Layout tool.- Specified by:
getCurrentLayoutToolin interfaceLayoutControl- Returns:
- LayoutBehavior Current Layout Tool.
-
getFirstPoint
Description copied from interface:LayoutControlIt returns the first click point of mouse.- Specified by:
getFirstPointin interfaceLayoutControl- Returns:
- Point.
-
getPointAnt
Description copied from interface:LayoutControlReturns the previous click of mouse.- Specified by:
getPointAntin interfaceLayoutControl- Returns:
- Point.
-
getLastPoint
Description copied from interface:LayoutControlReturns the last click point of mouse.- Specified by:
getLastPointin interfaceLayoutControl- Returns:
- Point.
-
setFirstPoint
public void setFirstPoint()Description copied from interface:LayoutControlInserts the first click point of mouse.- Specified by:
setFirstPointin interfaceLayoutControl
-
setPointAnt
public void setPointAnt()Description copied from interface:LayoutControlInserts the previous click point of mouse.- Specified by:
setPointAntin interfaceLayoutControl
-
setLastPoint
public void setLastPoint()Description copied from interface:LayoutControlInserts the last click point of mouse.- Specified by:
setLastPointin interfaceLayoutControl
-
setPosition
Description copied from interface:LayoutControlInsert the position point and calculate the new position if the grid is actived.- Specified by:
setPositionin interfaceLayoutControl- Parameters:
point2- Position.
-
getPosition
Description copied from interface:LayoutControlReturns the position adjusted point.- Specified by:
getPositionin interfaceLayoutControl- Returns:
-
getAT
Description copied from interface:LayoutControlReturns the AffineTransform that is applying in the Layout.- Specified by:
getATin interfaceLayoutControl- Returns:
- AffineTransform
-
getGeometryAdapter
Description copied from interface:LayoutControlIt returns the current GeometryAdapter.- Specified by:
getGeometryAdapterin interfaceLayoutControl- Returns:
- Current GeometryAdapter.
-
delLastPoint
public void delLastPoint()Description copied from interface:LayoutControlRemove last point of geometryAdapter.- Specified by:
delLastPointin interfaceLayoutControl
-
addGeometryAdapterPoint
public int addGeometryAdapterPoint()Description copied from interface:LayoutControlAdd a new point to geometryAdapter.- Specified by:
addGeometryAdapterPointin interfaceLayoutControl- Returns:
- Number of points in the geometryAdapter.
-
setGeometryAdapterPoinPosition
public void setGeometryAdapterPoinPosition()Description copied from interface:LayoutControlChange the position of mousemoved point of geometryAdapter.- Specified by:
setGeometryAdapterPoinPositionin interfaceLayoutControl
-
clearMouseImage
public void clearMouseImage()Description copied from interface:LayoutControlClear the image of pointer of mouse.- Specified by:
clearMouseImagein interfaceLayoutControl
-
refresh
public void refresh()Description copied from interface:LayoutControlRefres the Layout.- Specified by:
refreshin interfaceLayoutControl
-
calculateTransformFromViewport
Calculates the affine transform using the viewport and the control size, instead of calculating it fromrect. as usual. This is required when the component size changes, asrect. has to be recalculated using the viewport, and thus we can't calculate the affine transform usingrect.- Returns:
- An matrix to transform from paper coordinates to screen coordinates
-
isDrawingCancelled
public boolean isDrawingCancelled()Description copied from interface:LayoutControlIt returns true if the drawing has been canceled.- Specified by:
isDrawingCancelledin interfaceLayoutControl- Returns:
- true if the drawn has been canceled.
-
setCancelDrawing
public void setCancelDrawing(boolean b) Description copied from interface:LayoutControlIt cancels the drawing if the parameter is true.- Specified by:
setCancelDrawingin interfaceLayoutControl- Parameters:
b- true if the drawing wants to be canceled
-
getReSel
Description copied from interface:LayoutControlReturns the rectangle of selection.- Specified by:
getReSelin interfaceLayoutControl- Returns:
- Rectangle of selection.
-
isReSel
public boolean isReSel()Description copied from interface:LayoutControlIt returns true if should draw the rectangle of selection and does the selection.- Specified by:
isReSelin interfaceLayoutControl- Returns:
- true if should draw the rectangle of selection.
-
setIsReSel
public void setIsReSel(boolean b) Description copied from interface:LayoutControlInsert true if should draw the rectangle of selection and does the selection.- Specified by:
setIsReSelin interfaceLayoutControl- Parameters:
b- boolean.
-
viewFull
public void viewFull() throws org.gvsig.fmap.dal.exception.ReadExceptionDescription copied from interface:LayoutControlIt does a full extent of the layers that contains the view of the FFrameView selected.- Specified by:
viewFullin interfaceLayoutControl- Throws:
org.gvsig.fmap.dal.exception.ReadException
-
getLayoutZooms
Description copied from interface:LayoutControlReturns the object to make zooms.- Specified by:
getLayoutZoomsin interfaceLayoutControl- Returns:
- FLayoutZooms.
-
getLayoutFunctions
Description copied from interface:LayoutControlReturns the object of FLayoutFunctions.- Specified by:
getLayoutFunctionsin interfaceLayoutControl- Returns:
- FLayoutFunctions
-
getLayoutContext
Description copied from interface:LayoutControlReturns the LayoutContext.- Specified by:
getLayoutContextin interfaceLayoutControl- Returns:
- LayoutContext.
-
setGeometryAdapter
Description copied from interface:LayoutControlInserts the geometryAdapter.- Specified by:
setGeometryAdapterin interfaceLayoutControl- Parameters:
adapter- GeometryAdapter.
-
getComponent
- Specified by:
getComponentin interfaceLayoutControl
-
update
- Specified by:
updatein interfaceorg.gvsig.tools.observer.Observer
-