kcl.waterloo.swing
Class GCGridContainer
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.jdesktop.swingx.JXPanel
-
- kcl.waterloo.graphics.GJBasicPanel
-
- kcl.waterloo.swing.GCGridContainer
-
- 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, GJGridInterface, GCGridContainerInterface
public class GCGridContainer extends GJBasicPanel implements GCGridContainerInterface, GJGridInterface, java.awt.event.ContainerListener
GCGridContainer class: houses a GCGrid and a GCInfoBar. Within the kcl.waterloo.swing package, aGCGridContainerprovides for support of a single GCGrid instance. It can form the content pane of aGXFrame, or be contained in the tabs of aGCTabbedContainer.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class kcl.waterloo.graphics.GJBasicPanel
GJBasicPanel.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 GCGridContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.Componentadd(java.awt.Component comp)java.awt.Componentadd(java.awt.Component comp, double row, double column)Adds a component to the contained grid.java.awt.Componentadd(java.awt.Component comp, double row, double column, double width, double height)Adds a component to the contained grid.java.awt.Componentadd(java.awt.Component comp, double row, double column, double width, double height, int tab)voidaddTab(java.lang.String s, java.awt.Component c)voidcomponentAdded(java.awt.event.ContainerEvent e)voidcomponentRemoved(java.awt.event.ContainerEvent e)GCFramecreateFrame()java.awt.ComponentgetComponentAt(int tab)Returns the component at the specified tab location.GCGridgetGrid()javax.swing.JLabelgetGridIndicator()Returns a reference to the JLabel used to output the grid positionGCInfoBargetInfoBar()Returns the presently selected GCInfoBar for the selected container if it is a GCGridContainer.double[]getLocation(java.awt.Component c)Returns the 2-D coordinates given a linear index.javax.swing.JLabelgetMousePositionIndicator()Returns a reference to the JLabel used to output the mouse positionjava.awt.ContainergetSelected()Returns the presently selected item.voidsetGrid(GCGrid grid)voidsetInfoBar(GCInfoBar bar)-
Methods inherited from class kcl.waterloo.graphics.GJBasicPanel
componentHidden, componentMoved, componentResized, componentShown, getAllComponents, getID, getImage, getTransferable, getTransferable, isBackgroundPainted, isOnEDT, paintComponent, print, print, setBackgroundPainted, setID
-
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, 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
-
-
-
-
Method Detail
-
createFrame
public GCFrame createFrame()
-
add
public java.awt.Component add(java.awt.Component comp)
- Overrides:
addin classjava.awt.Container
-
add
public java.awt.Component add(java.awt.Component comp, double row, double column)Description copied from interface:GCGridContainerInterfaceAdds a component to the contained grid. Throws UnsupportedOperationException if the target is not a GCGridContainerInterface.- Specified by:
addin interfaceGCGridContainerInterface- Parameters:
comp- - the added component, which will normally be wrapped in a GCGridElement instance.- Returns:
- the added component
-
add
public java.awt.Component add(java.awt.Component comp, double row, double column, double width, double height)Description copied from interface:GCGridContainerInterfaceAdds a component to the contained grid. Throws UnsupportedOperationException if the target is not a GCGridContainerInterface.- Specified by:
addin interfaceGCGridContainerInterface- Parameters:
comp- - the added component, which will normally be wrapped in a GCGridElement instance.- Returns:
- the added component
-
add
public java.awt.Component add(java.awt.Component comp, double row, double column, double width, double height, int tab) throws java.lang.UnsupportedOperationException- Specified by:
addin interfaceGCGridContainerInterface- Throws:
java.lang.UnsupportedOperationException
-
getComponentAt
public java.awt.Component getComponentAt(int tab)
Description copied from interface:GCGridContainerInterfaceReturns the component at the specified tab location.- Specified by:
getComponentAtin interfaceGCGridContainerInterface- Parameters:
tab-- Returns:
-
getGrid
public GCGrid getGrid()
- Returns:
- the grid
-
setGrid
public void setGrid(GCGrid grid)
- Parameters:
grid- the grid to set
-
getInfoBar
public GCInfoBar getInfoBar()
Description copied from interface:GCGridContainerInterfaceReturns the presently selected GCInfoBar for the selected container if it is a GCGridContainer. Throws UnsupportedOperationException otherwise.- Specified by:
getInfoBarin interfaceGCGridContainerInterface- Returns:
- the infoBar
-
setInfoBar
public void setInfoBar(GCInfoBar bar)
- Parameters:
bar-
-
getSelected
public java.awt.Container getSelected()
Description copied from interface:GCGridContainerInterfaceReturns the presently selected item. For a GCGridContainer instance this returns the instance. For a GCTabbedGridContainer, it returns the selected component which may or may not be a GCGridContainer.- Specified by:
getSelectedin interfaceGCGridContainerInterface- Returns:
- the Container
-
getGridIndicator
public javax.swing.JLabel getGridIndicator()
Description copied from interface:GJGridInterfaceReturns a reference to the JLabel used to output the grid position- Specified by:
getGridIndicatorin interfaceGJGridInterface- Returns:
- a JLabel
-
getMousePositionIndicator
public javax.swing.JLabel getMousePositionIndicator()
Description copied from interface:GJGridInterfaceReturns a reference to the JLabel used to output the mouse position- Specified by:
getMousePositionIndicatorin interfaceGJGridInterface- Returns:
- a JLabel
-
getLocation
public double[] getLocation(java.awt.Component c)
Returns the 2-D coordinates given a linear index. dx- Specified by:
getLocationin interfaceGJGridInterface- Parameters:
c-- Returns:
- the coordinates as an int[]
-
componentAdded
public void componentAdded(java.awt.event.ContainerEvent e)
- Specified by:
componentAddedin interfacejava.awt.event.ContainerListener- Overrides:
componentAddedin classGJBasicPanel
-
componentRemoved
public void componentRemoved(java.awt.event.ContainerEvent e)
- Specified by:
componentRemovedin interfacejava.awt.event.ContainerListener- Overrides:
componentRemovedin classGJBasicPanel
-
addTab
public void addTab(java.lang.String s, java.awt.Component c)
-
-
DMelt 3.0 © DataMelt by jWork.ORG