Package mgui.interfaces
Class InterfaceTabbedDisplayPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
mgui.interfaces.InterfacePanel
mgui.interfaces.InterfaceDisplayPanel
mgui.interfaces.InterfaceTabbedDisplayPanel
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.ComponentListener
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,AttributeListener
,AttributeObject
,DisplayListener
,DisplayPanelListener
,WindowContainer
,WindowListener
,InterfaceObject
,CategoryObject
,PopupMenuObject
,NamedObject
,ShapeModel3DListener
,ShapeListener
,SplitPanelListener
,Toolable<Tool>
,TreeObject
,CleanableObject
,XMLObject
,IconObject
public class InterfaceTabbedDisplayPanel extends InterfaceDisplayPanel implements java.beans.PropertyChangeListener, DisplayPanelListener
This class extends
InterfaceDisplayPanel
in order to provide a tabbed window
pane, similar to a typical web browser. It extends all the functionality necessary
to do this.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
Fields inherited from class mgui.interfaces.InterfaceDisplayPanel
currentModel, currentSelection, currentTool, displayPanelListeners, excludeToSelection, last_added_panel, last_removed_panel, last_split_orientation, mouse_listeners, objectTree, parent_panel, parentFrame, selectionIndex, titles, toolLock, window, workspace
Fields inherited from class mgui.interfaces.InterfacePanel
attributes, displayListeners, last_click_point, statusBar, tree_nodes, treeNode, type
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors Constructor Description InterfaceTabbedDisplayPanel(SessionFrame frame)
-
Method Summary
Modifier and Type Method Description void
addGraphicMouseListener(GraphicMouseListener s)
void
addPanel(java.lang.String tab, InterfaceGraphicWindow graphic_panel, java.lang.String title)
InterfaceDisplayPanel
addTab(java.lang.String name)
void
addTabbedDisplayListener(TabbedDisplayListener l)
boolean
addWindow(InterfaceGraphicWindow graphic_panel, java.lang.String title)
Adds a panel to this display panel, using the default split position, which depends on the previous addition.boolean
containsTab(java.lang.String name)
void
displayPanelChanged(DisplayPanelEvent e)
protected void
fireTabChanged()
java.util.ArrayList<InterfaceGraphicWindow>
getAllWindows()
Returns all graphics panels from all tabs in this display panel.InterfaceDisplayPanel
getCurrentPanel()
InterfaceGraphic
getLastAddedPanel()
Retrieves the last added panelInterfaceGraphic
getLastRemovedPanel()
Retrieves the last removed paneljavax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.java.util.ArrayList<InterfaceGraphicWindow>
getPanels()
InterfacePopupMenu
getPopupMenu()
Produces and returns a popup menu for this object.InterfaceDisplayPanel
getTab(java.lang.String name)
protected int
getTabIndex(java.lang.String name)
java.lang.String
getTreeLabel()
Returns the label text to appear in a tree node.java.util.ArrayList<InterfaceGraphicWindow>
getWindows()
Returns a list of the windows contained in this display panel.java.util.ArrayList<InterfaceGraphicWindow>
getWindowsDepthFirst()
Returns a list of the windows contained in this display panel.void
handlePopupEvent(java.awt.event.ActionEvent e)
Handles an event on this object's popup menu.void
propertyChange(java.beans.PropertyChangeEvent e)
void
removeGraphicMouseListener(GraphicMouseListener s)
void
removeTab(java.lang.String name)
void
removeTabbedDisplayListener(TabbedDisplayListener l)
void
resetPanels()
Removes all panels from this display panel, and removes all mouse listeners registered on them.boolean
setCurrentTool(Tool tool)
void
setStatusBar(InterfaceStatusBarPanel p)
void
setTitle(InterfaceDisplayPanel panel, java.lang.String name)
void
setTreeNode(InterfaceTreeNode treeNode)
Sets the children for this node'sInterfaceTreeNode
.void
showPopupMenu(java.awt.event.MouseEvent e)
Popup Menuvoid
updateDisplays()
void
updatePanels()
Instructs this display panel to regenerate based on its current state.void
writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progressBar)
Writes the XML representation of this object to file.Methods inherited from class mgui.interfaces.InterfaceDisplayPanel
actionPerformed, addColourMap, addDisplayPanelListener, addSelectionSet, addSelectionSet, addShape2D, addShapeInt, addShapeListener, addWindow, close, deregisterProgressBar, destroy, fireDisplayPanelChanged, getColourMaps, getCurrentSectionSet, getCurrentSelection, getCurrentShapeModel, getCurrentShapeSet, getCurrentTool, getCurrentTool2D, getCurrentTool3D, getCurrentToolGraph, getDTD, getLocalName, getNameMaps, getNextSplitPanel, getPanelNodes, getParentFrame, getShapeSet2D, getShortXML, getToolLock, getValidTitle, getWorkspace, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, init, isDestroyed, isToolable, isValidTitle, paintComponent, registerProgressBar, removeAllPanels, removeDisplayPanelListener, removeWindow, removeWindow, removeWindow, resetSelectionIndex, setCurrentSection, setCurrentSectionSet, setCurrentSelection, setCurrentShapeModel, setDefaultTool, setObjectTree, setShapeSet2D, setToolLock, shapeModelChanged, shapeUpdated, splitPanelChanged, splitWindow, toggleExpandedWindow, toString, updateDisplay, windowSourceChanged, windowUpdated, writeXML, writeXML
Methods inherited from class mgui.interfaces.InterfacePanel
_init, addDisplayListener, attributeUpdated, clean, cleanUpPanel, collapseAllCategories, collapseCategory, collapseOtherCategories, componentHidden, componentMoved, componentResized, componentShown, expandAllCategories, expandCategory, fireDisplayListeners, getAttribute, getAttributes, getAttributeValue, getLocalAttributes, getPopupMenu, getSource, getTitle, getType, issueTreeNode, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, removeDisplayListener, setAttribute, setAttributes, setSource, setType, showPanel, updateFromDialog, updateTreeNodes
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, 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
Methods inherited from class java.awt.Container
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
Methods inherited from class java.awt.Component
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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface mgui.interfaces.NamedObject
getName, setName
-
Constructor Details
-
InterfaceTabbedDisplayPanel
-
-
Method Details
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Overrides:
getObjectIcon
in classInterfaceDisplayPanel
- Returns:
-
fireTabChanged
protected void fireTabChanged() -
addTabbedDisplayListener
-
removeTabbedDisplayListener
-
addPanel
public void addPanel(java.lang.String tab, InterfaceGraphicWindow graphic_panel, java.lang.String title) -
addWindow
Description copied from class:InterfaceDisplayPanel
Adds a panel to this display panel, using the default split position, which depends on the previous addition. The convention for this is horizontal, then vertical, etc.- Overrides:
addWindow
in classInterfaceDisplayPanel
-
displayPanelChanged
- Specified by:
displayPanelChanged
in interfaceDisplayPanelListener
-
getLastAddedPanel
Retrieves the last added panel- Overrides:
getLastAddedPanel
in classInterfaceDisplayPanel
- Returns:
-
getLastRemovedPanel
Retrieves the last removed panel- Overrides:
getLastRemovedPanel
in classInterfaceDisplayPanel
- Returns:
-
addTab
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObject
Returns the label text to appear in a tree node.- Specified by:
getTreeLabel
in interfaceTreeObject
- Overrides:
getTreeLabel
in classInterfaceDisplayPanel
- Returns:
-
getTabIndex
protected int getTabIndex(java.lang.String name) -
removeTab
public void removeTab(java.lang.String name) -
getTab
-
setTitle
-
getCurrentPanel
-
containsTab
public boolean containsTab(java.lang.String name) -
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
getWindows
Description copied from class:InterfaceDisplayPanel
Returns a list of the windows contained in this display panel. Breadth-first, if this panel contains split panels.- Overrides:
getWindows
in classInterfaceDisplayPanel
- Returns:
-
getWindowsDepthFirst
Description copied from class:InterfaceDisplayPanel
Returns a list of the windows contained in this display panel. Depth-first, if this panel contains split panels.- Overrides:
getWindowsDepthFirst
in classInterfaceDisplayPanel
- Returns:
-
getPanels
- Overrides:
getPanels
in classInterfaceDisplayPanel
- Returns:
-
getAllWindows
Returns all graphics panels from all tabs in this display panel.- Overrides:
getAllWindows
in classInterfaceDisplayPanel
- Returns:
- a list of all panels in this set
-
updatePanels
public void updatePanels()Description copied from class:InterfaceDisplayPanel
Instructs this display panel to regenerate based on its current state.- Overrides:
updatePanels
in classInterfaceDisplayPanel
-
resetPanels
public void resetPanels()Description copied from class:InterfaceDisplayPanel
Removes all panels from this display panel, and removes all mouse listeners registered on them.- Overrides:
resetPanels
in classInterfaceDisplayPanel
-
updateDisplays
public void updateDisplays()- Overrides:
updateDisplays
in classInterfaceDisplayPanel
-
setCurrentTool
- Specified by:
setCurrentTool
in interfaceToolable<Tool>
- Overrides:
setCurrentTool
in classInterfaceDisplayPanel
-
setStatusBar
- Overrides:
setStatusBar
in classInterfaceDisplayPanel
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classInterfaceDisplayPanel
-
addGraphicMouseListener
- Overrides:
addGraphicMouseListener
in classInterfaceDisplayPanel
-
removeGraphicMouseListener
- Overrides:
removeGraphicMouseListener
in classInterfaceDisplayPanel
-
showPopupMenu
public void showPopupMenu(java.awt.event.MouseEvent e)Popup Menu- Specified by:
showPopupMenu
in interfacePopupMenuObject
- Overrides:
showPopupMenu
in classInterfacePanel
-
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Overrides:
getPopupMenu
in classInterfaceDisplayPanel
- Returns:
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObject
Handles an event on this object's popup menu.- Specified by:
handlePopupEvent
in interfacePopupMenuObject
- Overrides:
handlePopupEvent
in classInterfaceDisplayPanel
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progressBar) throws java.io.IOExceptionDescription copied from interface:XMLObject
Writes the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format ofXMLFormat.Ascii
will be used.- Specified by:
writeXML
in interfaceXMLObject
- Overrides:
writeXML
in classInterfaceDisplayPanel
- Parameters:
tab
- The number of tabs to place before the XML textwriter
- The writeroptions
- XMLOutputOptions defining the write parametersprogressBar
- Optional progress updater (may benull
)- Throws:
java.io.IOException
-