public class PlotConfigurator extends JFrame implements StoreSource, ChangeListener
Plot
.
The configuration controls are presented as a serious of tabbed panes. Each of these panes containing a set of "related" controls (such as controls for setting the Plot title, this pane contains a text area, plus font and colour selection).
Each pane of related controls has a data model that contains the state. These can be used to save and restore the complete configuration to some XML database.
When closed this window will be hidden, not disposed. If this therefore necessary that the user disposes of it when it is really no longer required.
Modifier and Type | Class and Description |
---|---|
protected class |
PlotConfigurator.CloseAction
Inner class defining Action for closing window.
|
protected class |
PlotConfigurator.DrawAction
Draw action.
|
protected class |
PlotConfigurator.ResetAction
Inner class defining action for resetting all values.
|
protected class |
PlotConfigurator.StoreAction
Inner class defining action for initiating the configuration
storage window.
|
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JPanel |
actionBar
Action buttons container.
|
protected String |
applicationName
Application name for the store to use.
|
protected JMenuItem |
autoDrawOptionsMenu |
protected JMenuItem |
closeFileMenu |
protected PlotConfiguration |
config
Graphics configuration object.
|
protected JPanel |
contentPane
Content pane of frame.
|
protected PlotController |
controller
PlotController.
|
protected ArrayList |
controlsList
List of PlotControls that have been added.
|
protected Element |
defaultConfig
The default configuration of all known elements.
|
protected static String |
defaultTitle
Default title for window: "Configure AST graphics options".
|
protected JMenuItem |
drawFileMenu |
protected JMenu |
fileMenu |
protected JMenuBar |
menuBar
Menubar and various menus and items that it contains.
|
protected JMenu |
optionsMenu |
protected JMenuItem |
saveConfigFileMenu |
protected JMenuItem |
saveConfigOptionsMenu |
protected StoreControlFrame |
storeControl
Graphics configuration store window.
|
protected String |
storeName
Name for the store file.
|
protected JTabbedPane |
tabbedPane
Tabbed pane.
|
protected String |
title
Title for window.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PlotConfigurator()
Create an instance.
|
PlotConfigurator(String title)
Create an instance, setting the window title.
|
PlotConfigurator(String title,
PlotController controller)
Create an instance that controls a Plot and has a given window
title.
|
PlotConfigurator(String title,
PlotController controller,
PlotConfiguration config,
String applicationName,
String storeName)
Create an instance that controls a Plot, has a given window
title and uses a pre-defined configuration.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAxes() |
protected void |
addAxisLabels() |
protected void |
addBorder() |
protected void |
addControls(PlotControls controls,
boolean append)
Add a "page" of controls to the tabbed pane.
|
protected void |
addDefaultControls()
Add the default list of controls currently provided by the
PlotConfiguration.
|
void |
addExtraControls(PlotControls controls,
boolean append)
Add a set of extra controls to the tabbed pane.
|
protected void |
addGrid() |
protected void |
addNumberLabels() |
void |
addText() |
protected void |
addTicks() |
void |
addTitle() |
protected void |
closeStoreConfigFrame()
Close the config store window.
|
protected void |
closeWindowEvent()
Close the window.
|
String |
getApplicationName()
Return a name for this application.
|
String |
getAst()
Get the complete AST description of all default components.
|
PlotConfiguration |
getConfiguration()
Get the PlotConfiguration object used to store the actual state.
|
String |
getStoreName()
Return a name for the configuration store (without any
directory information).
|
String |
getTagName()
Get a name for the top-level element associated with this
configuration.
|
protected void |
initFrame()
Initialise frame properties (disposal, title, menus etc.).
|
protected void |
initMenus()
Initialise the menu bar, action bar and related actions.
|
protected void |
initTabbedPane()
Initialise the tabbed pane of controls.
|
boolean |
isAutoDrawOption()
Get whether any changes are to be applied immediately or only when
"Draw" is pressed.
|
void |
openStoreWindow()
Create or open the configuration storage window.
|
void |
reset()
Reset everything to the default values.
|
void |
restoreState(Element rootElement)
Restore a previously saved configuration created by the
StoreSource.saveState(org.w3c.dom.Element) method. |
void |
reveal(int page)
Reveal a page of controls.
|
void |
saveState(Element rootElement)
Save the configuration with the given Element as the root of
the document.
|
void |
setAutoDrawOption(boolean state)
Set whether any changes are applied immediately or only when "Draw" is
pressed.
|
void |
stateChanged(ChangeEvent e) |
protected void |
storeControlClosed()
Configuration storage window is closed.
|
void |
update()
Force a send of the current configuration to the associated
plot, thus hopefully getting it to re-draw itself.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
protected JPanel contentPane
protected JPanel actionBar
protected JTabbedPane tabbedPane
protected JMenuBar menuBar
protected JMenu fileMenu
protected JMenuItem saveConfigFileMenu
protected JMenuItem drawFileMenu
protected JMenuItem closeFileMenu
protected JMenu optionsMenu
protected JMenuItem saveConfigOptionsMenu
protected JMenuItem autoDrawOptionsMenu
protected PlotConfiguration config
protected PlotController controller
protected StoreControlFrame storeControl
protected Element defaultConfig
protected static String defaultTitle
protected String applicationName
protected String storeName
protected String title
protected ArrayList controlsList
public PlotConfigurator()
public PlotConfigurator(String title)
public PlotConfigurator(String title, PlotController controller)
public PlotConfigurator(String title, PlotController controller, PlotConfiguration config, String applicationName, String storeName)
protected void initTabbedPane()
protected void initFrame()
protected void initMenus()
public String getAst()
public PlotConfiguration getConfiguration()
public void setAutoDrawOption(boolean state)
public boolean isAutoDrawOption()
protected void addDefaultControls()
public void addTitle()
protected void addAxisLabels()
protected void addNumberLabels()
protected void addGrid()
protected void addAxes()
protected void addBorder()
protected void addTicks()
public void addText()
public void addExtraControls(PlotControls controls, boolean append)
controls
- the controls (a JComponent that implements the
PlotControls interface).append
- whether to append the controls to the tabbed pane
list.protected void addControls(PlotControls controls, boolean append)
public void reveal(int page)
protected void closeWindowEvent()
public void update()
public void reset()
public void saveState(Element rootElement)
StoreSource
saveState
in interface StoreSource
public void restoreState(Element rootElement)
StoreSource
StoreSource.saveState(org.w3c.dom.Element)
method.restoreState
in interface StoreSource
public String getApplicationName()
StoreSource
getApplicationName
in interface StoreSource
public String getStoreName()
StoreSource
getStoreName
in interface StoreSource
public String getTagName()
StoreSource
getTagName
in interface StoreSource
public void openStoreWindow()
protected void storeControlClosed()
protected void closeStoreConfigFrame()
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.