Class InterfaceGraphicWindow

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
mgui.interfaces.InterfacePanel
mgui.interfaces.graphics.InterfaceGraphicWindow
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, InterfaceObject, CategoryObject, PopupMenuObject, NamedObject, ShapeListener, TreeObject, CleanableObject, XMLObject, IconObject
Direct Known Subclasses:
InterfaceDataTableTitle, InterfaceGraphDisplayTitle, InterfaceSplitPanel

public class InterfaceGraphicWindow
extends InterfacePanel
implements XMLObject, IconObject
Provides a title for an InterfaceGraphic window, which is a button.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    class  InterfaceGraphicWindow.GraphicButton
    Button to display window title; overrides UI delegate.

    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 InterfaceGraphic<?> old_panel  
    protected InterfaceGraphic<?> panel  
    protected WindowContainer parent_panel  
    protected InterfaceGraphicWindow.GraphicButton title_button  
    protected java.util.ArrayList<WindowListener> 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
    InterfaceGraphicWindow()  
    InterfaceGraphicWindow​(InterfaceGraphic<?> p)  
  • Method Summary

    Modifier and Type Method Description
    void addWindowListener​(WindowListener listener)  
    void destroy()
    Destroy this object (prepare it to be removed from memory)
    protected void firePanelChanged()  
    protected void fireWindowListeners​(WindowEvent event)  
    protected InterfaceDisplayPanel getDisplayPanel()  
    java.lang.String getDTD()
    Returns the Data Type Declaration (DTD) for this object's XML representation
    java.lang.String getLocalName()
    Returns the local name associated with this XML object.
    javax.swing.Icon getObjectIcon()
    Returns the Icon associated with this object.
    InterfaceGraphic<?> getOldPanel()  
    InterfaceGraphic<?> getPanel()  
    WindowContainer getParentPanel()  
    protected int getPopupLength()  
    InterfacePopupMenu getPopupMenu()
    Produces and returns a popup menu for this object.
    java.lang.String getShortXML​(int tab)
    Returns a short XML representation of this object.
    java.lang.String getTitle()  
    InterfaceGraphicWindow.GraphicButton getTitleButton()  
    java.lang.String getXML()
    Returns this object's XML representation as a single string.
    java.lang.String getXML​(int tab)
    Returns this object's XML representation as a single string.
    java.lang.String getXMLSchema()
    Returns the XML schema for this object's XML representation
    void handlePopupEvent​(java.awt.event.ActionEvent e)
    Handles an event on this object's popup menu.
    void handleXMLElementEnd​(java.lang.String localName)
    Handles the end of an XML element.
    void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
    Handles the start of an XML element.
    void handleXMLString​(java.lang.String s)
    Handles a string within an XML element.
    protected void init()  
    void removeWindowListener​(WindowListener listener)  
    void setName​(java.lang.String thisName)
    Sets the name for this object.
    void setPanel​(InterfaceGraphic<?> p)  
    void setPanelName​(java.lang.String title)  
    void setParentPanel​(WindowContainer panel)  
    java.lang.String toString()  
    void updateDisplay()
    Requests this panel to update its display.
    void updateTitle()  
    void writeXML​(int tab, java.io.Writer writer)
    Writes the XML representation of this object to file.
    void writeXML​(int tab, java.io.Writer writer, ProgressUpdater progressBar)
    Writes the XML representation of this object to file, as XMLType.Normal.
    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 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 mgui.interfaces.NamedObject

    getName
  • Field Details

  • Constructor Details

    • InterfaceGraphicWindow

      public InterfaceGraphicWindow()
    • InterfaceGraphicWindow

      public InterfaceGraphicWindow​(InterfaceGraphic<?> p)
  • Method Details

    • init

      protected void init()
      Specified by:
      init in class InterfacePanel
    • addWindowListener

      public void addWindowListener​(WindowListener listener)
    • removeWindowListener

      public void removeWindowListener​(WindowListener listener)
    • 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 InterfacePanel
    • getOldPanel

      public InterfaceGraphic<?> getOldPanel()
    • setParentPanel

      public void setParentPanel​(WindowContainer panel)
    • getParentPanel

      public WindowContainer getParentPanel()
    • getPopupMenu

      public InterfacePopupMenu getPopupMenu()
      Description copied from interface: PopupMenuObject
      Produces and returns a popup menu for this object.
      Specified by:
      getPopupMenu in interface PopupMenuObject
      Overrides:
      getPopupMenu in class InterfacePanel
      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 interface PopupMenuObject
      Overrides:
      handlePopupEvent in class InterfacePanel
    • getDisplayPanel

      protected InterfaceDisplayPanel getDisplayPanel()
    • getPopupLength

      protected int getPopupLength()
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Overrides:
      getObjectIcon in class InterfacePanel
      Returns:
    • setPanel

      public void setPanel​(InterfaceGraphic<?> p)
    • firePanelChanged

      protected void firePanelChanged()
    • fireWindowListeners

      protected void fireWindowListeners​(WindowEvent event)
    • updateTitle

      public void updateTitle()
    • 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 java.awt.Component
    • getPanel

      public InterfaceGraphic<?> getPanel()
    • getTitleButton

      public InterfaceGraphicWindow.GraphicButton getTitleButton()
    • getTitle

      public java.lang.String getTitle()
      Overrides:
      getTitle in class InterfacePanel
    • setPanelName

      public void setPanelName​(java.lang.String title)
    • 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 InterfacePanel
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.awt.Component
    • getDTD

      public java.lang.String getDTD()
      Description copied from interface: XMLObject
      Returns the Data Type Declaration (DTD) for this object's XML representation

      See http://en.wikipedia.org/wiki/Document_Type_Definition for a description.

      Specified by:
      getDTD in interface XMLObject
      Returns:
    • 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
      Returns:
    • getShortXML

      public java.lang.String getShortXML​(int tab)
      Description copied from interface: XMLObject
      Returns a short XML representation of this object.
      Specified by:
      getShortXML in interface XMLObject
      Returns:
    • getXML

      public java.lang.String getXML()
      Description copied from interface: XMLObject
      Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use the XMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater) functions to write larger objects to file.
      Specified by:
      getXML in interface XMLObject
      Returns:
    • getXML

      public java.lang.String getXML​(int tab)
      Description copied from interface: XMLObject
      Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use the XMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater) functions to write larger objects to file.
      Specified by:
      getXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the opening XML wrapper
      Returns:
    • getXMLSchema

      public java.lang.String getXMLSchema()
      Description copied from interface: XMLObject
      Returns the XML schema for this object's XML representation

      See http://en.wikipedia.org/wiki/XML_schema.

      Specified by:
      getXMLSchema in interface XMLObject
      Returns:
    • handleXMLElementEnd

      public void handleXMLElementEnd​(java.lang.String localName)
      Description copied from interface: XMLObject
      Handles the end of an XML element.
      Specified by:
      handleXMLElementEnd in interface XMLObject
      Parameters:
      localName - Local name of the element
    • handleXMLElementStart

      public void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
      Description copied from interface: XMLObject
      Handles the start of an XML element.
      Specified by:
      handleXMLElementStart in interface XMLObject
      Parameters:
      localName - Local name of the element
      attributes - Set of element attributes
      type - The XMLType of this element
    • handleXMLString

      public void handleXMLString​(java.lang.String s)
      Description copied from interface: XMLObject
      Handles a string within an XML element.
      Specified by:
      handleXMLString in interface XMLObject
      Parameters:
      s - String to handle
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, ProgressUpdater progressBar) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file, as XMLType.Normal. The default format of XMLFormat.Ascii will be used. The basic contract for this method is that it should not write a newline character at its start or end.
      Specified by:
      writeXML in interface XMLObject
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      progressBar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progressBar) 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
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progressBar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer) 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
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      Throws:
      java.io.IOException