public class ZoomControl
extends javax.swing.JComponent
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ZoomControl()
Initializes a new instance of the ZoomControl class.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getActiveColor()
Gets the color used to render depressed buttons.
|
java.awt.Color |
getBorderColor()
Gets the color of ZoomControl elements' borders.
|
int |
getCornerRadius()
Gets the corner radius of rounded child elements.
|
Brush |
getFill()
Gets the brush used to fill the ZoomControl elements.
|
java.awt.Color |
getInnerColor()
Gets the color of plus, minus and arrow icons.
|
float |
getMaxZoomFactor()
Gets the maximum zoom level allowed to set through this control.
|
float |
getMinZoomFactor()
Gets the minimum zoom level allowed to set through this control.
|
float |
getScrollStep()
Gets the scroll offset added when users click the pan arrows.
|
java.awt.Color |
getShadowColor()
Gets the shadow color.
|
boolean |
getShowLabel()
Gets a value indicating whether the label that shows the current zoom level should be visible.
|
boolean |
getSnapToZoomStep()
Gets whether the trackbar should snap to ZoomStep values when dragged.
|
TickPosition |
getTickPosition()
Gets the current tick position of the trackbar.
|
DiagramView |
getView()
Gets the DiagramView object controlled by this ZoomControl.
|
float |
getZoomFactor()
Gets current zoom level.
|
float |
getZoomStep()
Gets the amount by which to change zoom level when + and - buttons are clicked.
|
boolean |
isDoubleBuffered()
Overrides JComponent.isDoubleBuffered method.
|
boolean |
isOpaque()
Overrides JComponent.isOpaque method.
|
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e)
Implements MouseListener.mouseDragged
|
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e)
Implements MouseListener.mouseMoved
|
void |
mousePressed(java.awt.event.MouseEvent e)
Implements MouseListener.mousePressed
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Implements MouseListener.mouseReleased
|
protected void |
paintComponent(java.awt.Graphics g) |
void |
propertyChange(java.beans.PropertyChangeEvent args) |
void |
setActiveColor(java.awt.Color value)
Sets the color used to render depressed buttons.
|
void |
setBorderColor(java.awt.Color value)
Sets the color of ZoomControl elements' borders.
|
void |
setCornerRadius(int value)
Sets the corner radius of rounded child elements.
|
void |
setFill(Brush value)
Sets the brush used to fill the ZoomControl elements.
|
void |
setInnerColor(java.awt.Color value)
Sets the color of plus, minus and arrow icons.
|
void |
setMaxZoomFactor(float value)
Sets the maximum zoom level allowed to set through this control.
|
void |
setMinZoomFactor(float value)
Sets the minimum zoom level allowed to set through this control.
|
void |
setScrollStep(float value)
Sets the scroll offset added when users click the pan arrows.
|
void |
setShadowColor(java.awt.Color value)
Sets the shadow color.
|
void |
setShowLabel(boolean value)
Sets a value indicating whether the label that shows the current zoom level should be visible.
|
void |
setSnapToZoomStep(boolean value)
Sets whether the trackbar should snap to ZoomStep values when dragged.
|
void |
setTickPosition(TickPosition position)
Sets the current tick position of the trackbar.
|
void |
setView(DiagramView value)
Sets the DiagramView object controlled by this ZoomControl.
|
void |
setZoomFactor(float value)
Sets current zoom level.
|
void |
setZoomFactor(float value,
boolean applyConstraints) |
void |
setZoomStep(float value)
Sets the amount by which to change zoom level when + and - buttons are clicked.
|
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isLightweightComponent, isManagingFocus, 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, updateUI
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, validateTree
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, 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, transferFocusUpCycle
public ZoomControl()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void setZoomFactor(float value, boolean applyConstraints)
public boolean isOpaque()
isOpaque
in class javax.swing.JComponent
public boolean isDoubleBuffered()
isDoubleBuffered
in class javax.swing.JComponent
public void setZoomFactor(float value)
value
- A float value specifying the new zoom level.public float getZoomFactor()
public void setTickPosition(TickPosition position)
position
- A member of the TickPosition
enumeration.public TickPosition getTickPosition()
TickPosition
enumeration.public void setMinZoomFactor(float value)
value
- A float value specifying the minimum zoom level.public float getMinZoomFactor()
public void setMaxZoomFactor(float value)
value
- A float value specifying the maximum zoom level.public float getMaxZoomFactor()
public void setZoomStep(float value)
value
- A float value specifying the zoom level change.public float getZoomStep()
public void setSnapToZoomStep(boolean value)
value
- true to snap to multiples of ZoomStep, or false otherwise. The default value is true.public boolean getSnapToZoomStep()
public void setView(DiagramView value)
value
- The DiagramView object controlled by this ZoomControl.public DiagramView getView()
public void setShowLabel(boolean value)
value
- true to show the zoom level label, or false otherwise.public boolean getShowLabel()
public void setCornerRadius(int value)
value
- An integer value specifying the radius of corner arcs.public int getCornerRadius()
public void setShadowColor(java.awt.Color value)
value
- A java.awt.Color instance.public java.awt.Color getShadowColor()
public void setInnerColor(java.awt.Color value)
value
- A java.awt.Color instance.public java.awt.Color getInnerColor()
public void setBorderColor(java.awt.Color value)
value
- A java.awt.Color instance.public java.awt.Color getBorderColor()
public void setActiveColor(java.awt.Color value)
value
- A java.awt.Color instance.public java.awt.Color getActiveColor()
public void setFill(Brush value)
value
- A Brush
instance.public Brush getFill()
Brush
instance.public void setScrollStep(float value)
value
- A float value specifying the scroll offset.public float getScrollStep()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- A MouseEvent instance providing more information about the event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- A MouseEvent instance providing more information about the event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- A MouseEvent instance providing more information about the event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- A MouseEvent instance providing more information about the event.public void propertyChange(java.beans.PropertyChangeEvent args)
propertyChange
in interface java.beans.PropertyChangeListener