Class LayerViewPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.vividsolutions.jump.workbench.ui.LayerViewPanel
- All Implemented Interfaces:
LayerListener, LayerManagerProxy, SelectionManagerProxy, ImageObserver, MenuContainer, Serializable, Accessible
public class LayerViewPanel
extends JPanel
implements LayerListener, LayerManagerProxy, SelectionManagerProxy
Be sure to call #dispose() when the LayerViewPanel is no longer needed.
- Author:
- ed
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(LayerViewPanelListener listener) voidReturns an image with the dimensions of this panel.voiddispose()voiderase(Graphics2D g) voidFired when a feature is added to or removed from a layer, or when a feature is edited (using an EditTransaction).featuresWithVertex(Point2D viewPoint, double viewTolerance, Collection<Feature> features) voidfill(Graphics2D g, Color color) voidvoidvoidflash(org.locationtech.jts.geom.GeometryCollection geometryCollection) format(double d) protected Stringformat(double d, double pixelWidthInModelUnits) org.locationtech.jts.geom.GeometrygetFence()Note: the popup menu is shown only if the user right-clicks the panel.getToolTipText(MouseEvent event) Find the parent WorkBenchFrame.voidvoidstatic JPopupMenuvoidvoidremoveListener(LayerViewPanelListener listener) voidrepaint()voidforce the current tool to be reactivated on us. e.g. on task switchesvoidsetCurrentCursorTool(CursorTool newct) set a cursortool to associate with the layer view. will return immediatly if the old cursor tools is identical to the new one.voidsetDeferLayerEvents(boolean defer) voidsetViewportInitialized(boolean viewportInitialized) When a layer is added, if this flag is false, the viewport will be zoomed to the extent of the layer.voidThe Fence layer will be excluded.visibleLayerToFeaturesInFenceMap(org.locationtech.jts.geom.Geometry fence) The Fence layer will be included.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, updateMethods inherited from class 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 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, 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, 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, transferFocusUpCycle
-
Constructor Details
-
LayerViewPanel
-
-
Method Details
-
getToolTipWriter
-
getToolTipText
- Overrides:
getToolTipTextin classJComponent
-
visibleLayerToFeaturesInFenceMap
-
visibleLayerToFeaturesInFenceMap
-
popupMenu
-
getCurrentCursorTool
-
reSetCurrentCursorTool
public void reSetCurrentCursorTool()force the current tool to be reactivated on us. e.g. on task switches -
setCurrentCursorTool
set a cursortool to associate with the layer view. will return immediatly if the old cursor tools is identical to the new one.- Parameters:
newct- the new CursorTool
-
removeCurrentCursorTool
public void removeCurrentCursorTool() -
getWorkBenchFrame
-
setViewportInitialized
public void setViewportInitialized(boolean viewportInitialized) When a layer is added, if this flag is false, the viewport will be zoomed to the extent of the layer. -
getLastClickedPoint
Note: the popup menu is shown only if the user right-clicks the panel. Thus, popup-menu event handlers don't need to check whether the return value is null. -
getLastMouseLocation
-
getViewport
-
getJava2DConverter
-
getFence
public org.locationtech.jts.geom.Geometry getFence()- Returns:
- the fence in model-coordinates, or null if there is no fence
-
getLayerManager
- Specified by:
getLayerManagerin interfaceLayerManagerProxy
-
featuresChanged
Description copied from interface:LayerListenerFired when a feature is added to or removed from a layer, or when a feature is edited (using an EditTransaction). Warning: this event is fired often.- Specified by:
featuresChangedin interfaceLayerListener
-
categoryChanged
- Specified by:
categoryChangedin interfaceLayerListener
-
layerChanged
- Specified by:
layerChangedin interfaceLayerListener
-
createBlankPanelImage
Returns an image with the dimensions of this panel. Note that the image has an alpha component, and thus is not suitable for creating JPEGs -- they will look pinkish. -
repaint
-
superRepaint
public void superRepaint() -
paintComponent
- Overrides:
paintComponentin classJComponent
-
erase
-
fill
-
getContext
-
addListener
-
removeListener
-
format
- Returns:
- d rounded off to the distance represented by one pixel
-
format
-
fireSelectionChanged
public void fireSelectionChanged() -
getRenderingManager
-
featuresWithVertex
public Collection<Feature> featuresWithVertex(Point2D viewPoint, double viewTolerance, Collection<Feature> features) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
dispose
public void dispose() -
flash
-
getSelectionManager
- Specified by:
getSelectionManagerin interfaceSelectionManagerProxy
-
getBlackboard
-
flash
public void flash(org.locationtech.jts.geom.GeometryCollection geometryCollection) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
setDeferLayerEvents
public void setDeferLayerEvents(boolean defer)
-