Class StationModelCanvas

All Implemented Interfaces:
ActionListener, FocusListener, KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class StationModelCanvas extends EditCanvas
Class StationModelCanvas Manages the station model gui
Version:
$Revision: 1.69 $
Author:
IDV Development Team
See Also:
  • Constructor Details

    • StationModelCanvas

      public StationModelCanvas(StationModelManager smm, JFrame frame)
      Make me
      Parameters:
      smm - The manager
      frame - The frame to put me in
    • StationModelCanvas

      public StationModelCanvas(StationModelManager smm, boolean editable, JFrame frame)
      Make me
      Parameters:
      smm - The manager
      editable - Is this editable
      frame - The frame to put me in
  • Method Details

    • setHighlight

      public void setHighlight(Glyph g)
      Ovedrride the method so we can set the highlight label
      Overrides:
      setHighlight in class DisplayCanvas
      Parameters:
      g - Highlighted glyph
    • getLabelComponent

      protected JComponent getLabelComponent()
      Create the name label if needed.
      Overrides:
      getLabelComponent in class EditCanvas
      Returns:
      The component that holds the name label.
    • setName

      public void setName(String n)
      Set the label
      Overrides:
      setName in class Component
      Parameters:
      n - The name of the station model
    • setStationModel

      public void setStationModel(StationModel l)
      Set the current station model_
      Parameters:
      l - The station model
    • setStationModel

      public void setStationModel(StationModel newModel, boolean closeDialogs)
      Set the current station model
      Parameters:
      newModel - The station model
      closeDialogs - If true then close any dialog windows
    • doGroup

      public boolean doGroup()
      Does this canvas support grouping of glyphs.
      Overrides:
      doGroup in class EditCanvas
      Returns:
      Support grouping of glyphs.
    • getStationModel

      public StationModel getStationModel()
      Get the current station model
      Returns:
      The current station model
    • toString

      public String toString()
      Return the station model name
      Overrides:
      toString in class Component
      Returns:
      The station model name
    • initMenuBar

      public void initMenuBar(JMenuBar menuBar)
      Add the menus into the menu bar
      Overrides:
      initMenuBar in class EditCanvas
      Parameters:
      menuBar - The menu bar
    • makeEditMenu

      public JMenu makeEditMenu(JMenu editMenu)
      Make the edit menu
      Overrides:
      makeEditMenu in class EditCanvas
      Parameters:
      editMenu - edit menu
      Returns:
      edit menu
    • setPropertiesOnSelected

      public void setPropertiesOnSelected()
    • initSymbolsMenu

      public void initSymbolsMenu(JMenu m)
      initialize the symbols menu
      Parameters:
      m - menu
    • shouldShowAlignmentPoints

      public boolean shouldShowAlignmentPoints()
      Should we draw the alignment points in the canvas
      Returns:
      Draw the alignment points in the canvas
    • makeViewMenu

      public JMenu makeViewMenu(JMenu viewMenu)
      Make the view menu
      Overrides:
      makeViewMenu in class EditCanvas
      Parameters:
      viewMenu - view menu
      Returns:
      The view menu
    • setHelpTopDir

      public static void setHelpTopDir(String topDir)
    • makeStationModelMenuItems

      public static List makeStationModelMenuItems(List symbols, ObjectListener listener, StationModelManager smm)
      _more_
      Parameters:
      symbols - _more_
      listener - _more_
      smm - _more_
      Returns:
      _more_
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handle ui actions.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class EditCanvas
      Parameters:
      event - The action event
    • closeDialogs

      protected void closeDialogs()
      Close any open property dialogs
    • doClose

      protected void doClose()
      Close the gui
    • doSave

      public void doSave()
      Save the current station model
    • doRemove

      protected void doRemove()
      Remove the current station model
    • doRename

      protected void doRename()
      Rename the current station model
    • doNew

      protected void doNew()
      Create a new station model
    • getShapeDescriptors

      public List getShapeDescriptors()
      Create the list of shape descriptors form the xml
      Overrides:
      getShapeDescriptors in class EditCanvas
      Returns:
      List of shape descriptors
    • initializeGlyphFromXml

      protected void initializeGlyphFromXml(Glyph g, Element symbolNode)
      Initialize the new glyph from the given xml node. Only do this if the glyph is a MetSymbol
      Parameters:
      g - The new glyph
      symbolNode - The xml it was created from
    • doMakeContents

      protected Component doMakeContents()
      Make the gui
      Overrides:
      doMakeContents in class EditCanvas
      Returns:
      _gui
    • paint

      public void paint(Graphics g)
      Override the pain method do draw the axis lines
      Overrides:
      paint in class EditCanvas
      Parameters:
      g - The graphics to paint to
    • keyReleased

      public void keyReleased(KeyEvent e)
      handle event
      Specified by:
      keyReleased in interface KeyListener
      Overrides:
      keyReleased in class EditCanvas
      Parameters:
      e - event
    • doMakeMenuItems

      public List doMakeMenuItems(Glyph g, List l)
      Make popup menu items for the given glyph
      Overrides:
      doMakeMenuItems in class EditCanvas
      Parameters:
      g - The glyph
      l - List to put menu items into
      Returns:
      The list
    • doMakeMetSymbolMenu

      protected List doMakeMetSymbolMenu(MetSymbol metSymbol, List l, boolean forPopup)
      Make menu items for the given glyph
      Parameters:
      metSymbol - The glyph
      l - List ot put items in
      forPopup - Is this for a popup menu
      Returns:
      The list
    • showTextInPalette

      public boolean showTextInPalette()
      Determine whether this canvas should show text in a palette or not.
      Overrides:
      showTextInPalette in class EditCanvas
      Returns:
      Should text be shown
    • doDoubleClick

      protected void doDoubleClick(Glyph glyph)
      User double clicked on the glyph. Show the properties dialog.
      Overrides:
      doDoubleClick in class EditCanvas
      Parameters:
      glyph - Glyph that was clicked.
    • getShowParams

      public boolean getShowParams()
      Determine whether the editor should show parameters or not.
      Returns:
      true to show parameter selection.
    • notifyGlyphCreateComplete

      public void notifyGlyphCreateComplete(Glyph newGlyph, boolean diddleSelection, boolean fromPaste)
      Gets called when a new glyph has bee created.
      Overrides:
      notifyGlyphCreateComplete in class EditCanvas
      Parameters:
      newGlyph -
      diddleSelection -
      fromPaste -
    • showProperties

      public void showProperties(MetSymbol metSymbol)
      Show the properties dialog for the given symbol.
      Parameters:
      metSymbol - The symbol.
    • getDefaultFormatList

      public static List getDefaultFormatList(double value)
      Get list of format string
      Parameters:
      value - The value
      Returns:
      The format strings
    • getDefaultUnitList

      public static List getDefaultUnitList()
      Get list of default units TFO for the gui
      Returns:
      List of TFOS for choosing units
    • getCenter

      public Point getCenter()
      Return the center point of the canvas.
      Returns:
      center point in canvas coordinates.
    • transformInputX

      public int transformInputX(int x)
      Transform an X coordinate from Java coordinates to canvas coordinates.
      Overrides:
      transformInputX in class DisplayCanvas
      Parameters:
      x -
      Returns:
      x in canvas coordinates
    • transformInputY

      public int transformInputY(int y)
      Transform a Y coordinate from Java coordinates to canvas coordinates.
      Overrides:
      transformInputY in class DisplayCanvas
      Parameters:
      y -
      Returns:
      y in canvas coordinates
    • xxxtransformOutputX

      public int xxxtransformOutputX(int x)
      Transform an X coordinate from canvas coordinates to Java (screen) coordinates.
      Parameters:
      x -
      Returns:
      x in screen coordinates
    • xxxtransformOutputY

      public int xxxtransformOutputY(int y)
      Transform a Y coordinate from canvas coordinates to Java (screen) coordinates.
      Parameters:
      y -
      Returns:
      x in screen coordinates
    • xxxtransformOutput

      public Rectangle xxxtransformOutput(Rectangle r)
      Transform a Rectangle from canvas coordinates to Java (screen) coordinates.
      Parameters:
      r -
      Returns:
      rectangle in screen coordinates
    • transformInput

      public Rectangle transformInput(Rectangle r)
      Transform a Rectangle from Java (screen) coordinates to canvas coordinates.
      Overrides:
      transformInput in class DisplayCanvas
      Parameters:
      r -
      Returns:
      rectangle in canvas coordinates
    • xxxtransformOutput

      public Point xxxtransformOutput(Point r)
      Transform a Point from canvas coordinates to Java (screen) coordinates.
      Parameters:
      r -
      Returns:
      point in screen coordinates
    • transformInput

      public Point transformInput(Point r)
      Transform a Point from Java (screen) coordinates to canvas coordinates.
      Overrides:
      transformInput in class DisplayCanvas
      Parameters:
      r -
      Returns:
      rectangle in canvas coordinates