kcl.waterloo.graphics
Class GJBasicPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.jdesktop.swingx.JXPanel
-
- kcl.waterloo.graphics.GJBasicPanel
-
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable
- Direct Known Subclasses:
- GCGrid, GCGridContainer, GCGridElement, GCInfoBar, GJAbstractGraph0, GJAbstractGraphContainer, GJAxisPanel, GJMarginBar, GJResizablePanel, GJRoi
public class GJBasicPanel extends JXPanel implements java.awt.event.ContainerListener, java.awt.event.ComponentListener, java.awt.print.Printable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classGJBasicPanel.LocalTransferable
-
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 GJBasicPanel()GJBasicPanel(boolean flag)GJBasicPanel(java.awt.LayoutManager layout)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomponentAdded(java.awt.event.ContainerEvent e)voidcomponentHidden(java.awt.event.ComponentEvent e)voidcomponentMoved(java.awt.event.ComponentEvent e)voidcomponentRemoved(java.awt.event.ContainerEvent e)voidcomponentResized(java.awt.event.ComponentEvent e)voidcomponentShown(java.awt.event.ComponentEvent e)static java.util.ArrayList<javax.swing.JComponent>getAllComponents(javax.swing.JComponent c)doublegetID()java.awt.image.BufferedImagegetImage()Paints the component into aBufferedImageGJBasicPanel.LocalTransferablegetTransferable()Returns aTransferablefor this panel for use in CCP/DnD.GJBasicPanel.LocalTransferablegetTransferable(boolean vectorFlag)Returns aTransferablefor this panel for use in CCP/DnD.booleanisBackgroundPainted()Defines whether or not the background painted by this component.When background painting is disabled, background painting is deferred to the parent.booleanisOnEDT()Returns true when the method is called on the EDT.voidpaintComponent(java.awt.Graphics g)Overridden to provide Painter support.voidprint()intprint(java.awt.Graphics g, java.awt.print.PageFormat pf, int page)voidsetBackgroundPainted(boolean backPainted)Enables or disables the painting of background depending on the value of the parameter.voidsetID(double n)-
Methods inherited from class org.jdesktop.swingx.JXPanel
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, isInheritAlpha, isPaintBorderInsets, paint, setAlpha, setBackgroundPainter, setInheritAlpha, setOpaque, setPaintBorderInsets, setScrollableHeightHint, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth, setScrollableWidthHint
-
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, 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, 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, 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, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
GJBasicPanel
public GJBasicPanel()
-
GJBasicPanel
public GJBasicPanel(java.awt.LayoutManager layout)
-
GJBasicPanel
public GJBasicPanel(boolean flag)
-
-
Method Detail
-
setID
public void setID(double n)
-
getID
public double getID()
-
isOnEDT
public boolean isOnEDT()
Returns true when the method is called on the EDT. Useful in systems that provide a mechanism to refer all method calls for an instance to the EDT e.g. via javaObjectEDT in MATLAB.- Returns:
- true when called on the EDT
-
isBackgroundPainted
public boolean isBackgroundPainted()
Defines whether or not the background painted by this component.When background painting is disabled, background painting is deferred to the parent.- Returns:
- true if background is painted, false otherwise
- See Also:
setBackgroundPainted(boolean),Component.getBackground()
-
setBackgroundPainted
public void setBackgroundPainted(boolean backPainted)
Enables or disables the painting of background depending on the value of the parameter. Background painting is enabled by default.
- Parameters:
backPainted- if true, axis labels are painted- See Also:
isBackgroundPainted(),JComponent.setBackground(Color)
-
getAllComponents
public static java.util.ArrayList<javax.swing.JComponent> getAllComponents(javax.swing.JComponent c)
-
paintComponent
public void paintComponent(java.awt.Graphics g)
Description copied from class:JXPanelOverridden to provide Painter support. It will call backgroundPainter.paint() if it is not null, else it will call super.paintComponent().- Parameters:
g- theGraphicscontext in which to paint
-
print
public void print()
-
print
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int page) throws java.awt.print.PrinterException- Specified by:
printin interfacejava.awt.print.Printable- Throws:
java.awt.print.PrinterException
-
getImage
public java.awt.image.BufferedImage getImage()
Paints the component into aBufferedImage- Returns:
- a BufferedImage
-
getTransferable
public GJBasicPanel.LocalTransferable getTransferable()
Returns aTransferablefor this panel for use in CCP/DnD.- Returns:
- custom
Transferablesubclass
-
getTransferable
public GJBasicPanel.LocalTransferable getTransferable(boolean vectorFlag)
Returns aTransferablefor this panel for use in CCP/DnD. If vectorFlag is true, the returnedTransferablewill support both image and vector graphics. Otherwise, image data only.- Parameters:
vectorFlag-- Returns:
- custom
Transferablesubclass
-
componentAdded
public void componentAdded(java.awt.event.ContainerEvent e)
- Specified by:
componentAddedin interfacejava.awt.event.ContainerListener
-
componentRemoved
public void componentRemoved(java.awt.event.ContainerEvent e)
- Specified by:
componentRemovedin interfacejava.awt.event.ContainerListener
-
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)
- Specified by:
componentMovedin interfacejava.awt.event.ComponentListener
-
componentShown
public void componentShown(java.awt.event.ComponentEvent e)
- Specified by:
componentShownin interfacejava.awt.event.ComponentListener
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent e)
- Specified by:
componentHiddenin interfacejava.awt.event.ComponentListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG