Class DisplayCanvas

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
EditCanvas

public class DisplayCanvas extends JPanel
Class DisplayCanvas
Author:
IDV development team
See Also:
  • Field Details

    • CMD_CREATE

      public static final String CMD_CREATE
      _more_
      See Also:
    • CMD_TOFRONT

      public static final String CMD_TOFRONT
      _more_
      See Also:
    • CMD_TOBACK

      public static final String CMD_TOBACK
      _more_
      See Also:
    • CMD_CHANGE

      public static final String CMD_CHANGE
      _more_
      See Also:
    • CMD_REMOVE

      public static final String CMD_REMOVE
      _more_
      See Also:
    • CMD_MOVE

      public static final String CMD_MOVE
      _more_
      See Also:
    • DEFAULT_CURSOR

      public static final Cursor DEFAULT_CURSOR
      _more_
    • HAND_CURSOR

      public static final Cursor HAND_CURSOR
      _more_
    • MOVE_CURSOR

      public static final Cursor MOVE_CURSOR
      _more_
    • TEXT_CURSOR

      public static final Cursor TEXT_CURSOR
      _more_
    • NW_CURSOR

      public static final Cursor NW_CURSOR
      _more_
    • gridSpacing

      public int gridSpacing
    • showGrid

      public boolean showGrid
    • scaleFactor

      protected double scaleFactor
      The scaling
    • canvasBg

      protected Color canvasBg
      _more_
    • glyphs

      protected List glyphs
      _more_
    • highlightedGlyph

      protected Glyph highlightedGlyph
      _more_
  • Constructor Details

    • DisplayCanvas

      public DisplayCanvas()
      _more_
  • Method Details

    • setCanvasBackground

      public void setCanvasBackground(Color c)
      _more_
      Parameters:
      c - _more_
    • getGlyphs

      protected List getGlyphs()
      _more_
      Returns:
      _more_
    • setGlyphs

      protected void setGlyphs(List newGlyphs)
      _more_
      Parameters:
      newGlyphs -
    • isFocusTraversable

      public boolean isFocusTraversable()
      _more_
      Overrides:
      isFocusTraversable in class Component
      Returns:
      _more_
    • getContents

      public Component getContents()
      _more_
      Returns:
      _more_
    • snap

      public int snap(int p)
    • setShowGrid

      public void setShowGrid(boolean value)
      Set the ShowGrid property.
      Parameters:
      value - The new value for ShowGrid
    • getShowGrid

      public boolean getShowGrid()
      Get the ShowGrid property.
      Returns:
      The ShowGrid
    • increaseGridSpacing

      public void increaseGridSpacing()
    • decreaseGridSpacing

      public void decreaseGridSpacing()
    • doMakeContents

      protected Component doMakeContents()
      _more_
      Returns:
      _more_
    • paintGrid

      public void paintGrid(Graphics g)
    • paint

      public void paint(Graphics g)
      _more_
      Overrides:
      paint in class JComponent
      Parameters:
      g -
    • createGlyph

      public Glyph createGlyph(String glyphClass, int x, int y)
      _more_
      Parameters:
      glyphClass -
      x -
      y -
      Returns:
      _more_
    • repaint

      public void repaint(Glyph g)
      _more_
      Parameters:
      g -
    • addGlyph

      public void addGlyph(Glyph g)
      _more_
      Parameters:
      g -
    • select

      public void select(Rectangle r)
      _more_
      Parameters:
      r -
    • selectionChanged

      public void selectionChanged()
      _more_
    • hasSelection

      public boolean hasSelection()
      _more_
      Returns:
      _more_
    • addSelection

      public void addSelection(Glyph g)
      _more_
      Parameters:
      g -
    • isSelected

      public boolean isSelected(Glyph g)
      _more_
      Parameters:
      g -
      Returns:
      _more_
    • getSelection

      public List getSelection()
      _more_
      Returns:
      _more_
    • clearSelection

      public void clearSelection()
      _more_
    • clearAll

      public void clearAll()
      _more_
    • notifyGlyphMoved

      public void notifyGlyphMoved(Glyph theGlyph)
      _more_
      Parameters:
      theGlyph -
    • notifyGlyphMoveComplete

      public void notifyGlyphMoveComplete(Glyph theGlyph)
      _more_
      Parameters:
      theGlyph -
    • notifyGlyphCreateComplete

      public void notifyGlyphCreateComplete(Glyph g, boolean diddleSelection, boolean fromPaste)
      _more_
      Parameters:
      g -
      diddleSelection -
      fromPaste -
    • notifyGlyphCreateComplete

      public void notifyGlyphCreateComplete(Glyph g)
      _more_
      Parameters:
      g -
    • removeSelection

      public void removeSelection(Glyph g)
      _more_
      Parameters:
      g -
    • justRemoveGlyph

      public void justRemoveGlyph(Glyph g)
      _more_
      Parameters:
      g -
    • removeGlyph

      public void removeGlyph(Glyph g)
      _more_
      Parameters:
      g -
    • doRemove

      public void doRemove(Glyph g)
      _more_
      Parameters:
      g -
    • setHighlight

      public void setHighlight(Glyph g)
      _more_
      Parameters:
      g -
    • glyphChanged

      public void glyphChanged(Glyph g)
      _more_
      Parameters:
      g -
    • getImage

      public Image getImage(String path)
      _more_
      Parameters:
      path -
      Returns:
      _more_
    • findGlyph

      public Glyph findGlyph(String id)
      _more_
      Parameters:
      id -
      Returns:
      _more_
    • findGlyph

      public Glyph findGlyph(int x, int y)
      _more_
      Parameters:
      x -
      y -
      Returns:
      _more_
    • findGlyph

      public static Glyph findGlyph(List glyphs, int x, int y, double threshold)
      _more_
      Parameters:
      glyphs -
      x -
      y -
      threshold -
      Returns:
      _more_
    • moveToFront

      public void moveToFront(Glyph theGlyph)
      _more_
      Parameters:
      theGlyph -
    • moveToBack

      public void moveToBack(Glyph theGlyph)
      _more_
      Parameters:
      theGlyph -
    • transformInputX

      public int transformInputX(int x)
      _more_
      Parameters:
      x -
      Returns:
      _more_
    • transformInputY

      public int transformInputY(int x)
      _more_
      Parameters:
      x -
      Returns:
      _more_
    • transformOutputX

      public int transformOutputX(int x)
      _more_
      Parameters:
      x -
      Returns:
      _more_
    • transformOutputY

      public int transformOutputY(int x)
      _more_
      Parameters:
      x -
      Returns:
      _more_
    • transformOutput

      public Rectangle transformOutput(Rectangle r)
      _more_
      Parameters:
      r -
      Returns:
      _more_
    • transformInput

      public Rectangle transformInput(Rectangle r)
      _more_
      Parameters:
      r -
      Returns:
      _more_
    • transformOutput

      public Point transformOutput(Point r)
      _more_
      Parameters:
      r -
      Returns:
      _more_
    • transformInput

      public Point transformInput(Point r)
      _more_
      Parameters:
      r -
      Returns:
      _more_