public class IOPView extends javax.swing.JComponent implements ZoomListener, javax.swing.event.ChangeListener
The following figure shows how an IOPView is composed. The toolbar with standard zooming buttons and an output area in a split pane are optional. Without an output area, no split pane is used.
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 |
---|
IOPView() |
IOPView(boolean scrollbars,
boolean toolbar) |
IOPView(boolean scrollbars,
boolean toolbar,
boolean output)
Create an IOPView with given parameters.
|
IOPView(Glyphish glyphs) |
IOPView(Glyphish glyphs,
java.awt.geom.AffineTransform position) |
IOPView(Glyphish glyphs,
boolean scrollbars,
boolean toolbar) |
IOPView(Glyphish glyphs,
boolean scrollbars,
boolean toolbar,
boolean output) |
Modifier and Type | Method and Description |
---|---|
void |
add(Glyphish glyphs) |
void |
add(Glyphish glyphs,
java.awt.geom.AffineTransform position) |
void |
addButton(javax.swing.AbstractButton button) |
void |
addButton(javax.swing.AbstractButton button,
int i) |
void |
addMItem(IOPMenuItem item)
Adds a new menu item to the currently active text menu in output.
|
void |
addOutput()
Adds a text output area at bottom of this view if it doesn't exist yet.
|
void |
addToolBar() |
void |
addZoomListener(ZoomListener zl)
Add given zoom listener to list of objects to be notified upon
zoom change.
|
void |
centerOn(Glyphish g)
Deprecated.
use combination of
getIOPComponent() and
IOPComponent.centerOn(java.awt.geom.Rectangle2D) instead |
void |
centerOn(java.awt.geom.Rectangle2D rect)
Deprecated.
use combination of
getIOPComponent() and
IOPComponent.centerOn(java.awt.geom.Rectangle2D) instead |
void |
checkSize() |
void |
clearOutput()
Clear output area (if output set).
|
void |
displayText(java.lang.String label,
java.lang.String text,
boolean closebutton)
Display label and text in output area (if output set).
|
void |
displayTextMenu(java.lang.String label,
java.util.List<?> list)
Display new text menu in output area (if output set).
|
IOPComponent |
getIOPComponent() |
IOPScrollPane |
getScrollPane() |
IOPToolBar |
getToolBar() |
java.awt.Dimension |
getVisible()
Obtain dimension of visible part of IOPComponent.
|
double |
getZoom()
Obtain current zoom factor in effect for embedded glyphs.
|
void |
remove(Glyphish glyphs) |
void |
removeZoomListener(ZoomListener zl)
Remove given zoom listener from list of objects to be notified
upon zoom change.
|
void |
requestFocus() |
void |
setGraph(IOPGraph graph) |
void |
setKeyAction(int type,
Closure fun) |
void |
setMouseAction(int type,
Closure fun) |
void |
setPreferredSize(int width,
int height)
Deprecated.
JComponent.setPreferredSize(java.awt.Dimension) instead. |
void |
stateChanged(javax.swing.event.ChangeEvent event) |
void |
zoom(double factor)
Apply given factor to current zoom.
|
java.awt.geom.Rectangle2D |
zoomBound(java.awt.geom.Rectangle2D bound) |
void |
zoomChanged(double scale)
Called when zoom has changed.
|
void |
zoomIn()
Zoom in by static factor.
|
void |
zoomOut()
Zoom out by static factor.
|
java.awt.geom.Point2D |
zoomPoint(java.awt.event.MouseEvent e) |
void |
zoomToFit()
Zoom to fit to current view port.
|
void |
zoomToFit(double width,
double height) |
void |
zoomToFit(java.awt.geom.Rectangle2D rect)
Zoom to fit to given rectangle.
|
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, 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 IOPView()
public IOPView(Glyphish glyphs)
public IOPView(boolean scrollbars, boolean toolbar)
public IOPView(Glyphish glyphs, java.awt.geom.AffineTransform position)
public IOPView(boolean scrollbars, boolean toolbar, boolean output)
scrollbars
- Whether to display scrollbars for IOPComponenttoolbar
- Whether to include the standard toolbar with zooming buttonsoutput
- Whether to reserve space for an output panel to be included
in a split panepublic IOPView(Glyphish glyphs, boolean scrollbars, boolean toolbar)
public IOPView(Glyphish glyphs, boolean scrollbars, boolean toolbar, boolean output)
public IOPComponent getIOPComponent()
public IOPToolBar getToolBar()
public IOPScrollPane getScrollPane()
public void addToolBar()
public void addButton(javax.swing.AbstractButton button)
public void addButton(javax.swing.AbstractButton button, int i)
public void addOutput()
public void clearOutput()
public void displayText(java.lang.String label, java.lang.String text, boolean closebutton)
label
- Short label to be used as headingtext
- Text to be displayed (not wrapped in text area)closebutton
- Indicates whether to display a button to close
text area with outputpublic void displayTextMenu(java.lang.String label, java.util.List<?> list)
label
- String used as heading for menulist
- List of IOPMenuItems filling menuIOPMenuItem
public void addMItem(IOPMenuItem item)
item
- IOPMenuItem to be addedpublic void setGraph(IOPGraph graph)
public void add(Glyphish glyphs)
public void add(Glyphish glyphs, java.awt.geom.AffineTransform position)
public void remove(Glyphish glyphs)
public void addZoomListener(ZoomListener zl)
zl
- ZoomListener to be notified upon zoom changepublic void removeZoomListener(ZoomListener zl)
zl
- ZoomListener to be removedpublic void zoomChanged(double scale)
ZoomListener
zoomChanged
in interface ZoomListener
scale
- New zoom scale that is in effectpublic double getZoom()
public void zoom(double factor)
factor
- Zoom factor to applypublic void zoomIn()
public void zoomOut()
public void zoomToFit()
public void zoomToFit(java.awt.geom.Rectangle2D rect)
rect
- Rectanglepublic void zoomToFit(double width, double height)
width
- the desired widthheight
- the desired heightpublic void setMouseAction(int type, Closure fun)
public void setKeyAction(int type, Closure fun)
public void centerOn(Glyphish g)
getIOPComponent()
and
IOPComponent.centerOn(java.awt.geom.Rectangle2D)
insteadg
- the glyph that wants the attentionpublic void centerOn(java.awt.geom.Rectangle2D rect)
getIOPComponent()
and
IOPComponent.centerOn(java.awt.geom.Rectangle2D)
insteadrect
- the rectanglepublic java.awt.Dimension getVisible()
public void setPreferredSize(int width, int height)
JComponent.setPreferredSize(java.awt.Dimension)
instead.width
- the preferred width.height
- the preferred height.public void checkSize()
public void requestFocus()
requestFocus
in class javax.swing.JComponent
public java.awt.geom.Point2D zoomPoint(java.awt.event.MouseEvent e)
public java.awt.geom.Rectangle2D zoomBound(java.awt.geom.Rectangle2D bound)
public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged
in interface javax.swing.event.ChangeListener