Class InterfaceSplitPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
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.GraphicButton

    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
    Modifier and Type Field Description
    protected java.util.ArrayList<SplitPanelListener> listeners  
    protected InterfaceGraphicWindow panel1  
    protected InterfaceGraphicWindow panel2  
    protected int split_orientation  

    Fields inherited from class mgui.interfaces.graphics.InterfaceGraphicWindow

    old_panel, panel, parent_panel, title_button, window_listeners

    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
    InterfaceSplitPanel​(int direction, InterfaceGraphicWindow panel1, InterfaceGraphicWindow panel2)  
  • Method Summary

    Modifier and Type Method Description
    void addSplitPanelListener​(SplitPanelListener listener)  
    void destroy()
    Destroy this object (prepare it to be removed from memory)
    InterfaceGraphicWindow findWindow​(java.lang.String name)
    Searches this split pane for a window with the title name.
    protected void fireSplitPanelChanged​(SplitPanelEvent event)  
    void flip()
    Flips the orientation of this split panel.
    java.lang.String getLocalName()
    Returns the local name associated with this XML object.
    InterfaceGraphicWindow getOtherWindow​(InterfaceGraphicWindow window)
    Returns the window that is not window, if one exists.
    InterfaceGraphic<?> getPanel()  
    InterfaceSplitPanel getParent​(InterfaceGraphicWindow window)
    Returns the parent panel of window.InterfaceSplitPanel
    int getSide​(InterfaceGraphicWindow window)
    Returns the side of the split pane window is on.
    int getSplitOrientation()
    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 tree
    java.util.Stack<InterfaceGraphicWindow> getSplitPanelStack()
    Returns a stack of split panels, with the top-most being the highest in the nested tree
    double getSplitRatio()  
    InterfaceGraphicWindow getWindow​(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 void init()  
    void removeSplitPanelListener​(SplitPanelListener listener)  
    void removeWindow​(InterfaceGraphicWindow window)
    Remove child from this container, and notify listeners.
    void removeWindow​(InterfaceGraphicWindow window, boolean notify)
    Remove child from this container.
    boolean replace​(InterfaceGraphicWindow old, InterfaceGraphicWindow nieuw)
    Replace old with nieuw.
    void setName​(java.lang.String thisName)
    Sets the name for this object.
    void setPanel​(InterfaceGraphic p)  
    void setSplitRatio​(double loc)  
    void swap()
    Swaps the two components of this split panel
    java.lang.String toString()  
    void updateDisplay()
    Requests this panel to update its display.
    void updateTitle()  
    void windowSourceChanged​(WindowEvent e)  
    void windowUpdated​(WindowEvent e)  
    void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)
    Writes the XML representation of this object to file.

    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, 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, 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, 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 java.awt.event.ComponentListener

    componentHidden, componentMoved, componentResized, componentShown

    Methods inherited from interface mgui.interfaces.NamedObject

    getName
  • Field Details

  • Constructor Details

  • Method Details

    • setSplitRatio

      public void setSplitRatio​(double loc)
    • getSplitRatio

      public double getSplitRatio()
    • destroy

      public void destroy()
      Description copied from interface: InterfaceObject
      Destroy this object (prepare it to be removed from memory)
      Specified by:
      destroy in interface InterfaceObject
      Specified by:
      destroy in interface ShapeListener
      Overrides:
      destroy in class InterfaceGraphicWindow
    • addSplitPanelListener

      public void addSplitPanelListener​(SplitPanelListener listener)
    • removeSplitPanelListener

      public void removeSplitPanelListener​(SplitPanelListener listener)
    • fireSplitPanelChanged

      protected void fireSplitPanelChanged​(SplitPanelEvent event)
    • getSplitOrientation

      public int getSplitOrientation()
      Returns the current orientation for this split panel; see JSplitPane.VERTICAL_SPLIT.
      Returns:
    • getOtherWindow

      public InterfaceGraphicWindow getOtherWindow​(InterfaceGraphicWindow window)
      Returns the window that is not window, if one exists.
      Parameters:
      window -
      Returns:
      The other window, or null if there is none, or if window is not a child of this split panel
    • windowUpdated

      public void windowUpdated​(WindowEvent e)
      Specified by:
      windowUpdated in interface WindowListener
    • windowSourceChanged

      public void windowSourceChanged​(WindowEvent e)
      Specified by:
      windowSourceChanged in interface WindowListener
    • getWindowsBreadthFirst

      public 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.
      Parameters:
      max_depth - The maximum depth in the nesting tree to search
      Returns:
    • getWindowsDepthFirst

      public 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).
      Returns:
    • getParent

      public InterfaceSplitPanel getParent​(InterfaceGraphicWindow window)
      Returns the parent panel of window.InterfaceSplitPanel
      Parameters:
      window -
      Returns:
      The parent, or null if window is not found.
    • replace

      public boolean replace​(InterfaceGraphicWindow old, InterfaceGraphicWindow nieuw)
      Replace old with nieuw.
      Parameters:
      old -
      nieuw -
      Returns:
      true if window was replaced; false if there is no such window
    • removeWindow

      public void removeWindow​(InterfaceGraphicWindow window)
      Description copied from interface: WindowContainer
      Remove child from this container, and notify listeners.
      Specified by:
      removeWindow in interface WindowContainer
    • removeWindow

      public void removeWindow​(InterfaceGraphicWindow window, boolean notify)
      Description copied from interface: WindowContainer
      Remove child from this container.
      Specified by:
      removeWindow in interface WindowContainer
      notify - Whether to notify listeners
    • getSide

      public int getSide​(InterfaceGraphicWindow window)
      Returns the side of the split pane window is on.
      Returns:
      0 for left/top; 1 for right/bottom; -1 if not in this panel
    • getWindow

      public InterfaceGraphicWindow getWindow​(int side)
      Returns the window on the specified side of the panel; where 0 = left, 1 = right.
      Parameters:
      side -
      Returns:
    • findWindow

      public InterfaceGraphicWindow findWindow​(java.lang.String name)
      Searches this split pane for a window with the title name.
      Parameters:
      name -
      Returns:
      The window, or null if 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

      public java.util.Stack<InterfaceGraphicWindow> 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

      protected java.util.ArrayList<InterfaceGraphicWindow> getWindows​(int depth, int max_depth)
    • init

      protected void init()
      Overrides:
      init in class InterfaceGraphicWindow
    • setPanel

      public void setPanel​(InterfaceGraphic p)
      Overrides:
      setPanel in class InterfaceGraphicWindow
    • updateTitle

      public void updateTitle()
      Overrides:
      updateTitle in class InterfaceGraphicWindow
    • setName

      public void setName​(java.lang.String thisName)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
      Overrides:
      setName in class InterfaceGraphicWindow
    • getPanel

      public InterfaceGraphic<?> getPanel()
      Overrides:
      getPanel in class InterfaceGraphicWindow
    • updateDisplay

      public void updateDisplay()
      Description copied from class: InterfacePanel
      Requests this panel to update its display.
      Specified by:
      updateDisplay in interface DisplayListener
      Overrides:
      updateDisplay in class InterfaceGraphicWindow
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class InterfaceGraphicWindow
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Overrides:
      getLocalName in class InterfaceGraphicWindow
      Returns:
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException
      Description 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 of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Overrides:
      writeXML in class InterfaceGraphicWindow
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException