de.erichseifert.gral.ui
Class InteractivePanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- de.erichseifert.gral.ui.DrawablePanel
-
- de.erichseifert.gral.ui.InteractivePanel
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible
public class InteractivePanel extends DrawablePanel implements java.awt.print.Printable
A panel implementation that displays aDrawableinstance as a rich Swing component.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description InteractivePanel(Drawable drawable)Creates a new panel instance and initializes it with a drawable component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanisPannable()Returns whether the plot area in the panel can be panned.booleanisPopupMenuEnabled()Returns whether a popup menu will be shown by this panel when the user takes the appropriate action.booleanisZoomable()Returns whether the plot area in the panel can be zoomed.intprint(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)Prints the page at the specified index into the specifiedGraphicscontext in the specified format.voidsetPannable(boolean pannable)Sets whether the plot area in the panel can be panned.voidsetPopupMenuEnabled(boolean popupMenuEnabled)Sets whether a popup menu will be shown by this panel when the user takes the appropriate action.voidsetZoomable(boolean zoomable)Sets whether the plot area in the panel can be zoomed.-
Methods inherited from class de.erichseifert.gral.ui.DrawablePanel
getDrawable, getMinimumSize, getPreferredSize, isAntialiased, setAntialiased, setBounds, setBounds
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
InteractivePanel
public InteractivePanel(Drawable drawable)
Creates a new panel instance and initializes it with a drawable component.- Parameters:
drawable- Drawable component.
-
-
Method Detail
-
isPopupMenuEnabled
public boolean isPopupMenuEnabled()
Returns whether a popup menu will be shown by this panel when the user takes the appropriate action. The necessary action depends on the operating system of the user.- Returns:
truewhen a popup menu will be shown, otherwisefalse.
-
setPopupMenuEnabled
public void setPopupMenuEnabled(boolean popupMenuEnabled)
Sets whether a popup menu will be shown by this panel when the user takes the appropriate action. The necessary action depends on the operating system of the user.- Parameters:
popupMenuEnabled-truewhen a popup menu should be shown, otherwisefalse.
-
print
public int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex) throws java.awt.print.PrinterExceptionPrints the page at the specified index into the specifiedGraphicscontext in the specified format.- Specified by:
printin interfacejava.awt.print.Printable- Parameters:
g- the context into which the page is drawnpageFormat- the size and orientation of the page being drawnpageIndex- the zero based index of the page to be drawn- Returns:
- PAGE_EXISTS if the page is rendered successfully
or NO_SUCH_PAGE if
pageIndexspecifies a non-existent page. - Throws:
java.awt.print.PrinterException- thrown when the print job is terminated.
-
isZoomable
public boolean isZoomable()
Returns whether the plot area in the panel can be zoomed.- Returns:
trueif the plot can be zoomed,falseotherwise.
-
setZoomable
public void setZoomable(boolean zoomable)
Sets whether the plot area in the panel can be zoomed.- Parameters:
zoomable-trueif the plot should be zoomable,falseotherwise.
-
isPannable
public boolean isPannable()
Returns whether the plot area in the panel can be panned.- Returns:
trueif the plot can be panned,falseotherwise.
-
setPannable
public void setPannable(boolean pannable)
Sets whether the plot area in the panel can be panned.- Parameters:
pannable-trueif the plot should be pannable,falseotherwise.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG