public class StationModelCanvas extends EditCanvas
EditCanvas.ShapeDescriptorjavax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentCMD_ALIGN_BOTTOM, CMD_ALIGN_CENTER, CMD_ALIGN_LEFT, CMD_ALIGN_MIDDLE, CMD_ALIGN_PREFIX, CMD_ALIGN_RIGHT, CMD_ALIGN_TOP, CMD_EDIT_COPY, CMD_EDIT_CUT, CMD_EDIT_GROUP, CMD_EDIT_PASTE, CMD_EDIT_SELECTALL, CMD_EDIT_TOBACK, CMD_EDIT_TOFRONT, CMD_EDIT_UNGROUP, CMD_SNAP, CMD_SPACE_H, CMD_SPACE_V, CMD_ZOOMIN, CMD_ZOOMOUT, CMD_ZOOMRESETcanvasBg, CMD_CHANGE, CMD_CREATE, CMD_MOVE, CMD_REMOVE, CMD_TOBACK, CMD_TOFRONT, DEFAULT_CURSOR, glyphs, gridSpacing, HAND_CURSOR, highlightedGlyph, MOVE_CURSOR, NW_CURSOR, scaleFactor, showGrid, TEXT_CURSORlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
StationModelCanvas(StationModelManager smm,
boolean editable,
javax.swing.JFrame frame)
Make me
|
StationModelCanvas(StationModelManager smm,
javax.swing.JFrame frame)
Make me
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Handle ui actions.
|
protected void |
closeDialogs()
Close any open property dialogs
|
protected void |
doClose()
Close the gui
|
protected void |
doDoubleClick(Glyph glyph)
User double clicked on the glyph.
|
boolean |
doGroup()
Does this canvas support grouping of glyphs.
|
protected java.awt.Component |
doMakeContents()
Make the gui
|
java.util.List |
doMakeMenuItems(Glyph g,
java.util.List l)
Make popup menu items for the given glyph
|
protected java.util.List |
doMakeMetSymbolMenu(MetSymbol metSymbol,
java.util.List l,
boolean forPopup)
Make menu items for the given glyph
|
protected void |
doNew()
Create a new station model
|
protected void |
doRemove()
Remove the current station model
|
protected void |
doRename()
Rename the current station model
|
void |
doSave()
Save the current station model
|
java.awt.Point |
getCenter()
Return the center point of the canvas.
|
static java.util.List |
getDefaultFormatList(double value)
Get list of format string
|
static java.util.List |
getDefaultUnitList()
Get list of default units TFO for the gui
|
protected javax.swing.JComponent |
getLabelComponent()
Create the name label if needed.
|
java.util.List |
getShapeDescriptors()
Create the list of shape descriptors form the xml
|
boolean |
getShowParams()
Determine whether the editor should show parameters or not.
|
StationModel |
getStationModel()
Get the current station model
|
protected void |
initializeGlyphFromXml(Glyph g,
org.w3c.dom.Element symbolNode)
Initialize the new glyph from the given xml node.
|
void |
initMenuBar(javax.swing.JMenuBar menuBar)
Add the menus into the menu bar
|
void |
initSymbolsMenu(javax.swing.JMenu m)
initialize the symbols menu
|
void |
keyReleased(java.awt.event.KeyEvent e)
handle event
|
javax.swing.JMenu |
makeEditMenu(javax.swing.JMenu editMenu)
Make the edit menu
|
static java.util.List |
makeStationModelMenuItems(java.util.List symbols,
ObjectListener listener,
StationModelManager smm)
_more_
|
javax.swing.JMenu |
makeViewMenu(javax.swing.JMenu viewMenu)
Make the view menu
|
void |
notifyGlyphCreateComplete(Glyph newGlyph,
boolean diddleSelection,
boolean fromPaste)
Gets called when a new glyph has bee created.
|
void |
paint(java.awt.Graphics g)
Override the pain method do draw the axis lines
|
static void |
setHelpTopDir(java.lang.String topDir) |
void |
setHighlight(Glyph g)
Ovedrride the method so we can set the highlight label
|
void |
setName(java.lang.String n)
Set the label
|
void |
setPropertiesOnSelected() |
void |
setStationModel(StationModel l)
Set the current station model_
|
void |
setStationModel(StationModel newModel,
boolean closeDialogs)
Set the current station model
|
boolean |
shouldShowAlignmentPoints()
Should we draw the alignment points in the canvas
|
void |
showProperties(MetSymbol metSymbol)
Show the properties dialog for the given symbol.
|
boolean |
showTextInPalette()
Determine whether this canvas should show text in a palette
or not.
|
java.lang.String |
toString()
Return the station model name
|
java.awt.Point |
transformInput(java.awt.Point r)
Transform a
Point from Java (screen) coordinates to canvas
coordinates. |
java.awt.Rectangle |
transformInput(java.awt.Rectangle r)
Transform a
Rectangle |
int |
transformInputX(int x)
Transform an X coordinate from Java coordinates to canvas
coordinates.
|
int |
transformInputY(int y)
Transform a Y coordinate from Java coordinates to canvas
coordinates.
|
java.awt.Point |
xxxtransformOutput(java.awt.Point r)
Transform a
Point from canvas coordinates to Java
(screen) coordinates. |
java.awt.Rectangle |
xxxtransformOutput(java.awt.Rectangle r)
Transform a
Rectangle from canvas coordinates to Java
(screen) coordinates. |
int |
xxxtransformOutputX(int x)
Transform an X coordinate from canvas coordinates to Java
(screen) coordinates.
|
int |
xxxtransformOutputY(int y)
Transform a Y coordinate from canvas coordinates to Java
(screen) coordinates.
|
cloneGlyphs, doAlign, doCopy, doCut, doMakePalette, doMakeToolbar, doPaste, doPaste, doToBack, doToFront, doZoomIn, doZoomOut, focusGained, focusLost, getHaveChanged, getMenuBar, group, haveCommand, keyPressed, keyTyped, loadXml, makeDescriptor, makeEditMenu, makeMenuItem, makeMenuItem, makeSelectionMenuItem, makeViewMenu, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mousePressedInner, mouseReleased, notifyGlyphChanged, notifyGlyphChangeDone, notifyGlyphMoveComplete, notifyGlyphMoved, okToPaintHighlight, selectAll, selectionChanged, setColor, setColor, setCommand, setDefaultCursor, setHaveChanged, snapToGrid, spaceH, spaceV, togglePressed, unGroupaddGlyph, addSelection, clearAll, clearSelection, createGlyph, decreaseGridSpacing, doRemove, findGlyph, findGlyph, findGlyph, getContents, getGlyphs, getImage, getSelection, getShowGrid, glyphChanged, hasSelection, increaseGridSpacing, isFocusTraversable, isSelected, justRemoveGlyph, moveToBack, moveToFront, notifyGlyphCreateComplete, paintGrid, removeGlyph, removeSelection, repaint, select, setCanvasBackground, setGlyphs, setShowGrid, snap, transformOutput, transformOutput, transformOutputX, transformOutputYgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, 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, updateadd, 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, validateTreeaction, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCyclepublic StationModelCanvas(StationModelManager smm, javax.swing.JFrame frame)
smm - The managerframe - The frame to put me inpublic StationModelCanvas(StationModelManager smm, boolean editable, javax.swing.JFrame frame)
smm - The managereditable - Is this editableframe - The frame to put me inpublic void setHighlight(Glyph g)
setHighlight in class DisplayCanvasg - Highlighted glyphprotected javax.swing.JComponent getLabelComponent()
getLabelComponent in class EditCanvaspublic void setName(java.lang.String n)
setName in class java.awt.Componentn - The name of the station modelpublic void setStationModel(StationModel l)
l - The station modelpublic void setStationModel(StationModel newModel, boolean closeDialogs)
newModel - The station modelcloseDialogs - If true then close any dialog windowspublic boolean doGroup()
doGroup in class EditCanvaspublic StationModel getStationModel()
public java.lang.String toString()
toString in class java.awt.Componentpublic void initMenuBar(javax.swing.JMenuBar menuBar)
initMenuBar in class EditCanvasmenuBar - The menu barpublic javax.swing.JMenu makeEditMenu(javax.swing.JMenu editMenu)
makeEditMenu in class EditCanvaseditMenu - edit menupublic void setPropertiesOnSelected()
public void initSymbolsMenu(javax.swing.JMenu m)
m - menupublic boolean shouldShowAlignmentPoints()
public javax.swing.JMenu makeViewMenu(javax.swing.JMenu viewMenu)
makeViewMenu in class EditCanvasviewMenu - view menupublic static void setHelpTopDir(java.lang.String topDir)
public static java.util.List makeStationModelMenuItems(java.util.List symbols,
ObjectListener listener,
StationModelManager smm)
symbols - _more_listener - _more_smm - _more_public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class EditCanvasevent - The action eventprotected void closeDialogs()
protected void doClose()
public void doSave()
protected void doRemove()
protected void doRename()
protected void doNew()
public java.util.List getShapeDescriptors()
getShapeDescriptors in class EditCanvasprotected void initializeGlyphFromXml(Glyph g, org.w3c.dom.Element symbolNode)
g - The new glyphsymbolNode - The xml it was created fromprotected java.awt.Component doMakeContents()
doMakeContents in class EditCanvaspublic void paint(java.awt.Graphics g)
paint in class EditCanvasg - The graphics to paint topublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerkeyReleased in class EditCanvase - eventpublic java.util.List doMakeMenuItems(Glyph g, java.util.List l)
doMakeMenuItems in class EditCanvasg - The glyphl - List to put menu items intoprotected java.util.List doMakeMetSymbolMenu(MetSymbol metSymbol, java.util.List l, boolean forPopup)
metSymbol - The glyphl - List ot put items inforPopup - Is this for a popup menupublic boolean showTextInPalette()
showTextInPalette in class EditCanvasprotected void doDoubleClick(Glyph glyph)
doDoubleClick in class EditCanvasglyph - Glyph that was clicked.public boolean getShowParams()
public void notifyGlyphCreateComplete(Glyph newGlyph, boolean diddleSelection, boolean fromPaste)
notifyGlyphCreateComplete in class EditCanvasnewGlyph - diddleSelection - fromPaste - public void showProperties(MetSymbol metSymbol)
metSymbol - The symbol.public static java.util.List getDefaultFormatList(double value)
value - The valuepublic static java.util.List getDefaultUnitList()
public java.awt.Point getCenter()
public int transformInputX(int x)
transformInputX in class DisplayCanvasx - public int transformInputY(int y)
transformInputY in class DisplayCanvasy - public int xxxtransformOutputX(int x)
x - public int xxxtransformOutputY(int y)
y - public java.awt.Rectangle xxxtransformOutput(java.awt.Rectangle r)
Rectangle from canvas coordinates to Java
(screen) coordinates.r - public java.awt.Rectangle transformInput(java.awt.Rectangle r)
Rectangle from Java (screen) coordinates to
canvas coordinates.transformInput in class DisplayCanvasr - public java.awt.Point xxxtransformOutput(java.awt.Point r)
Point from canvas coordinates to Java
(screen) coordinates.r - public java.awt.Point transformInput(java.awt.Point r)
Point from Java (screen) coordinates to canvas
coordinates.transformInput in class DisplayCanvasr -