Package mgui.interfaces
Class InterfaceSplitPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
mgui.interfaces.InterfacePanel
mgui.interfaces.graphics.InterfaceGraphicWindow
mgui.interfaces.InterfaceSplitPanel
- All Implemented Interfaces:
java.awt.event.ComponentListener,java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,AttributeListener,AttributeObject,DisplayListener,WindowContainer,WindowListener,InterfaceObject,CategoryObject,PopupMenuObject,NamedObject,ShapeListener,TreeObject,CleanableObject,XMLObject,IconObject
public class InterfaceSplitPanel extends InterfaceGraphicWindow implements java.awt.event.ComponentListener, WindowContainer
Displays two
InterfaceGraphicWindows, split either horizontally or vertically. The split ratio is
adjustable.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class mgui.interfaces.graphics.InterfaceGraphicWindow
InterfaceGraphicWindow.GraphicButtonNested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyNested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<SplitPanelListener>listenersprotected InterfaceGraphicWindowpanel1protected InterfaceGraphicWindowpanel2protected intsplit_orientationFields inherited from class mgui.interfaces.graphics.InterfaceGraphicWindow
old_panel, panel, parent_panel, title_button, window_listenersFields inherited from class mgui.interfaces.InterfacePanel
attributes, displayListeners, isDestroyed, last_click_point, statusBar, tree_nodes, treeNode, typeFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors Constructor Description InterfaceSplitPanel(int direction, InterfaceGraphicWindow panel1, InterfaceGraphicWindow panel2) -
Method Summary
Modifier and Type Method Description voidaddSplitPanelListener(SplitPanelListener listener)voiddestroy()Destroy this object (prepare it to be removed from memory)InterfaceGraphicWindowfindWindow(java.lang.String name)Searches this split pane for a window with the titlename.protected voidfireSplitPanelChanged(SplitPanelEvent event)voidflip()Flips the orientation of this split panel.java.lang.StringgetLocalName()Returns the local name associated with this XML object.InterfaceGraphicWindowgetOtherWindow(InterfaceGraphicWindow window)Returns the window that is notwindow, if one exists.InterfaceGraphic<?>getPanel()InterfaceSplitPanelgetParent(InterfaceGraphicWindow window)Returns the parent panel ofwindow.InterfaceSplitPanelintgetSide(InterfaceGraphicWindow window)Returns the side of the split panewindowis on.intgetSplitOrientation()Returns the current orientation for this split panel; see JSplitPane.VERTICAL_SPLIT.protected java.util.PriorityQueue<mgui.interfaces.InterfaceSplitPanel.DepthPanel>getSplitPanelQueue(int depth)Returns a reversed queue of split panels, with the bottom-most being the highest in the nested treejava.util.Stack<InterfaceGraphicWindow>getSplitPanelStack()Returns a stack of split panels, with the top-most being the highest in the nested treedoublegetSplitRatio()InterfaceGraphicWindowgetWindow(int side)Returns the window on the specified side of the panel; where 0 = left, 1 = right.protected java.util.ArrayList<InterfaceGraphicWindow>getWindows(int depth, int max_depth)java.util.ArrayList<InterfaceGraphicWindow>getWindowsBreadthFirst()Returns a breadth-first list of windows contained by this split panel; meaning that the first windows are on the top-most level and later windows are increasingly deep in the nesting tree.java.util.ArrayList<InterfaceGraphicWindow>getWindowsDepthFirst()Returns a depth-first list of all windows contained by this split panel or its nested panels (left or top first).protected voidinit()voidremoveSplitPanelListener(SplitPanelListener listener)voidremoveWindow(InterfaceGraphicWindow window)Removechildfrom this container, and notify listeners.voidremoveWindow(InterfaceGraphicWindow window, boolean notify)Removechildfrom this container.booleanreplace(InterfaceGraphicWindow old, InterfaceGraphicWindow nieuw)Replaceoldwithnieuw.voidsetName(java.lang.String thisName)Sets the name for this object.voidsetPanel(InterfaceGraphic p)voidsetSplitRatio(double loc)voidswap()Swaps the two components of this split paneljava.lang.StringtoString()voidupdateDisplay()Requests this panel to update its display.voidupdateTitle()voidwindowSourceChanged(WindowEvent e)voidwindowUpdated(WindowEvent e)voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.Methods inherited from class mgui.interfaces.graphics.InterfaceGraphicWindow
addWindowListener, firePanelChanged, fireWindowListeners, getDisplayPanel, getDTD, getObjectIcon, getOldPanel, getParentPanel, getPopupLength, getPopupMenu, getShortXML, getTitle, getTitleButton, getXML, getXML, getXMLSchema, handlePopupEvent, handleXMLElementEnd, handleXMLElementStart, handleXMLString, removeWindowListener, setPanelName, setParentPanel, writeXML, writeXMLMethods 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, getTreeLabel, getType, isDestroyed, issueTreeNode, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, removeDisplayListener, setAttribute, setAttributes, setSource, setStatusBar, setTreeNode, setType, shapeUpdated, showPanel, showPopupMenu, updateDisplays, updateFromDialog, updateTreeNodesMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, paintComponent, 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, updateMethods 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, validateTreeMethods 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, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.ComponentListener
componentHidden, componentMoved, componentResized, componentShownMethods inherited from interface mgui.interfaces.NamedObject
getName
-
Field Details
-
split_orientation
protected int split_orientation -
panel1
-
panel2
-
listeners
-
-
Constructor Details
-
InterfaceSplitPanel
public InterfaceSplitPanel(int direction, InterfaceGraphicWindow panel1, InterfaceGraphicWindow panel2)
-
-
Method Details
-
setSplitRatio
public void setSplitRatio(double loc) -
getSplitRatio
public double getSplitRatio() -
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject- Specified by:
destroyin interfaceShapeListener- Overrides:
destroyin classInterfaceGraphicWindow
-
addSplitPanelListener
-
removeSplitPanelListener
-
fireSplitPanelChanged
-
getSplitOrientation
public int getSplitOrientation()Returns the current orientation for this split panel; see JSplitPane.VERTICAL_SPLIT.- Returns:
-
getOtherWindow
Returns the window that is notwindow, if one exists.- Parameters:
window-- Returns:
- The other window, or
nullif there is none, or ifwindowis not a child of this split panel
-
windowUpdated
- Specified by:
windowUpdatedin interfaceWindowListener
-
windowSourceChanged
- Specified by:
windowSourceChangedin interfaceWindowListener
-
getWindowsBreadthFirst
Returns a breadth-first list of windows contained by this split panel; meaning that the first windows are on the top-most level and later windows are increasingly deep in the nesting tree.- Parameters:
max_depth- The maximum depth in the nesting tree to search- Returns:
-
getWindowsDepthFirst
Returns a depth-first list of all windows contained by this split panel or its nested panels (left or top first).- Returns:
-
getParent
Returns the parent panel ofwindow.InterfaceSplitPanel- Parameters:
window-- Returns:
- The parent, or
nullif window is not found.
-
replace
Replaceoldwithnieuw.- Parameters:
old-nieuw-- Returns:
trueif window was replaced;falseif there is no such window
-
removeWindow
Description copied from interface:WindowContainerRemovechildfrom this container, and notify listeners.- Specified by:
removeWindowin interfaceWindowContainer
-
removeWindow
Description copied from interface:WindowContainerRemovechildfrom this container.- Specified by:
removeWindowin interfaceWindowContainernotify- Whether to notify listeners
-
getSide
Returns the side of the split panewindowis on.- Returns:
- 0 for left/top; 1 for right/bottom; -1 if not in this panel
-
getWindow
Returns the window on the specified side of the panel; where 0 = left, 1 = right.- Parameters:
side-- Returns:
-
findWindow
Searches this split pane for a window with the titlename.- Parameters:
name-- Returns:
- The window, or
nullif not found.
-
flip
public void flip()Flips the orientation of this split panel. -
swap
public void swap()Swaps the two components of this split panel -
getSplitPanelStack
Returns a stack of split panels, with the top-most being the highest in the nested tree- Returns:
-
getSplitPanelQueue
protected java.util.PriorityQueue<mgui.interfaces.InterfaceSplitPanel.DepthPanel> getSplitPanelQueue(int depth)Returns a reversed queue of split panels, with the bottom-most being the highest in the nested tree- Returns:
-
getWindows
-
init
protected void init()- Overrides:
initin classInterfaceGraphicWindow
-
setPanel
- Overrides:
setPanelin classInterfaceGraphicWindow
-
updateTitle
public void updateTitle()- Overrides:
updateTitlein classInterfaceGraphicWindow
-
setName
public void setName(java.lang.String thisName)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject- Overrides:
setNamein classInterfaceGraphicWindow
-
getPanel
- Overrides:
getPanelin classInterfaceGraphicWindow
-
updateDisplay
public void updateDisplay()Description copied from class:InterfacePanelRequests this panel to update its display.- Specified by:
updateDisplayin interfaceDisplayListener- Overrides:
updateDisplayin classInterfaceGraphicWindow
-
toString
public java.lang.String toString()- Overrides:
toStringin classInterfaceGraphicWindow
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Overrides:
getLocalNamein classInterfaceGraphicWindow- Returns:
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites 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.Asciiwill be used.- Specified by:
writeXMLin interfaceXMLObject- Overrides:
writeXMLin classInterfaceGraphicWindow- Parameters:
tab- The number of tabs to place before the XML textwriter- The writeroptions- XMLOutputOptions defining the write parametersprogress_bar- Optional progress updater (may benull)- Throws:
java.io.IOException
-