|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ucar.unidata.ui.drawing.DisplayCanvas
ucar.unidata.ui.drawing.EditCanvas
ucar.unidata.ui.symbol.StationModelCanvas
public class StationModelCanvas
Class StationModelCanvas Manages the station model gui
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ucar.unidata.ui.drawing.EditCanvas |
|---|
EditCanvas.ShapeDescriptor |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class ucar.unidata.ui.drawing.EditCanvas |
|---|
CMD_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_ZOOMRESET |
| Fields inherited from class ucar.unidata.ui.drawing.DisplayCanvas |
|---|
canvasBg, 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_CURSOR |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, 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 |
|---|
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 | |
|---|---|
StationModelCanvas(StationModelManager smm,
boolean editable,
JFrame frame)
Make me |
|
StationModelCanvas(StationModelManager smm,
JFrame frame)
Make me |
|
| Method Summary | |
|---|---|
void |
actionPerformed(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 Component |
doMakeContents()
Make the gui |
List |
doMakeMenuItems(Glyph g,
List l)
Make popup menu items for the given glyph |
protected List |
doMakeMetSymbolMenu(MetSymbol metSymbol,
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 |
Point |
getCenter()
Return the center point of the canvas. |
static List |
getDefaultFormatList(double value)
Get list of format string |
static List |
getDefaultUnitList()
Get list of default units TFO for the gui |
protected JComponent |
getLabelComponent()
Create the name label if needed. |
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,
Element symbolNode)
Initialize the new glyph from the given xml node. |
void |
initMenuBar(JMenuBar menuBar)
Add the menus into the menu bar |
void |
initSymbolsMenu(JMenu m)
initialize the symbols menu |
void |
keyReleased(KeyEvent e)
handle event |
JMenu |
makeEditMenu(JMenu editMenu)
Make the edit menu |
static List |
makeStationModelMenuItems(List symbols,
ObjectListener listener,
StationModelManager smm)
_more_ |
JMenu |
makeViewMenu(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(Graphics g)
Override the pain method do draw the axis lines |
static void |
setHelpTopDir(String topDir)
|
void |
setHighlight(Glyph g)
Ovedrride the method so we can set the highlight label |
void |
setName(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. |
String |
toString()
Return the station model name |
Point |
transformInput(Point r)
Transform a Point from Java (screen) coordinates to canvas
coordinates. |
Rectangle |
transformInput(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. |
Point |
xxxtransformOutput(Point r)
Transform a Point from canvas coordinates to Java
(screen) coordinates. |
Rectangle |
xxxtransformOutput(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. |
| Methods inherited from class ucar.unidata.ui.drawing.EditCanvas |
|---|
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, unGroup |
| Methods inherited from class ucar.unidata.ui.drawing.DisplayCanvas |
|---|
addGlyph, 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, transformOutputY |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StationModelCanvas(StationModelManager smm,
JFrame frame)
smm - The managerframe - The frame to put me in
public StationModelCanvas(StationModelManager smm,
boolean editable,
JFrame frame)
smm - The managereditable - Is this editableframe - The frame to put me in| Method Detail |
|---|
public void setHighlight(Glyph g)
setHighlight in class DisplayCanvasg - Highlighted glyphprotected JComponent getLabelComponent()
getLabelComponent in class EditCanvaspublic void setName(String n)
setName in class Componentn - The name of the station modelpublic void setStationModel(StationModel l)
l - The station model
public 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 String toString()
toString in class Componentpublic void initMenuBar(JMenuBar menuBar)
initMenuBar in class EditCanvasmenuBar - The menu barpublic JMenu makeEditMenu(JMenu editMenu)
makeEditMenu in class EditCanvaseditMenu - edit menu
public void setPropertiesOnSelected()
public void initSymbolsMenu(JMenu m)
m - menupublic boolean shouldShowAlignmentPoints()
public JMenu makeViewMenu(JMenu viewMenu)
makeViewMenu in class EditCanvasviewMenu - view menu
public static void setHelpTopDir(String topDir)
public static List makeStationModelMenuItems(List symbols,
ObjectListener listener,
StationModelManager smm)
symbols - _more_listener - _more_smm - _more_
public void actionPerformed(ActionEvent event)
actionPerformed in interface 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 List getShapeDescriptors()
getShapeDescriptors in class EditCanvas
protected void initializeGlyphFromXml(Glyph g,
Element symbolNode)
g - The new glyphsymbolNode - The xml it was created fromprotected Component doMakeContents()
doMakeContents in class EditCanvaspublic void paint(Graphics g)
paint in class EditCanvasg - The graphics to paint topublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerkeyReleased in class EditCanvase - event
public List doMakeMenuItems(Glyph g,
List l)
doMakeMenuItems in class EditCanvasg - The glyphl - List to put menu items into
protected List doMakeMetSymbolMenu(MetSymbol metSymbol,
List l,
boolean forPopup)
metSymbol - The glyphl - List ot put items inforPopup - Is this for a popup menu
public 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 List getDefaultFormatList(double value)
value - The value
public static List getDefaultUnitList()
public 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 Rectangle xxxtransformOutput(Rectangle r)
Rectangle from canvas coordinates to Java
(screen) coordinates.
r -
public Rectangle transformInput(Rectangle r)
Rectangle from Java (screen) coordinates to
canvas coordinates.
- Overrides:
transformInput in class DisplayCanvas
- Parameters:
r -
- Returns:
- rectangle in canvas coordinates
public Point xxxtransformOutput(Point r)
Point from canvas coordinates to Java
(screen) coordinates.
r -
public Point transformInput(Point r)
Point from Java (screen) coordinates to canvas
coordinates.
transformInput in class DisplayCanvasr -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||