Class XALSynopticPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class XALSynopticPanel extends JPanel
XALSynopticPanel is simple panel, that shows synoptic layout of selected XAL sequence. Synoptic is drawn in horizontal direction. To define right or left distance of drawing from the edge of panel, use margins. To define which part of sequence should be drawn, use start and end position.
Since:
Aug 29, 2003. TODO Fire events for mouse selection of elements TODO Add element selection dialog for choosing single from multiple selection TODO Implement SNS official color code
Author:
Igor Kriznar
See Also:
  • Constructor Details

    • XALSynopticPanel

      public XALSynopticPanel()
      Default constructor.
  • Method Details

    • main

      public static void main(String[] args)
      This runs simple test applet.
      Parameters:
      args - CMD args
    • getAcceleratorSequence

      public AcceleratorSeq getAcceleratorSequence()
      Get the accelerator sequence, which is displayed from first to last by synoptic defined element.
      Returns:
      the accelerator sequence, which is displayed from first to last by synoptic defined element
    • setAcceleratorSequence

      public void setAcceleratorSequence(AcceleratorSeq seq)
      Sets accelerator sequence. Note that this method might take some time to finish, if sequence contains a lot of elements. Uses beginning and end of this sequence for initial start and end position.
      Parameters:
      seq -
    • setAcceleratorSequence

      public void setAcceleratorSequence(AcceleratorSeq seq, double start, double end)
      Sets accelerator sequence and initial start and end position in sequence. Note that this method might take some time to finish, if sequence contains a lot of elements.
      Parameters:
      seq -
    • setWrapShift

      public void setWrapShift(double shift)
      Set the shift in the location where the wrapping occurs (relevant only for rings)
      Parameters:
      shift - the shift (meters) in location along the ring where positions are measured in positive versus negative numbers relative to the origin
    • getEndPosition

      public double getEndPosition()
      Get the position in sequence up to which elements are drawn.
      Returns:
      the position in sequence up to which elements are drawn
    • getStartPosition

      public double getStartPosition()
      Get the position in sequence from which elements are drawn.
      Returns:
      the position in the sequence from which elements are drawn
    • setEndPosition

      public void setEndPosition(double d)
      Sets position in sequence up to which elements are drawn. Must be more than start position.
      Parameters:
      d -
      Throws:
      IllegalArgumentException - if new end is less then start position
    • setStartPosition

      public void setStartPosition(double d)
      Sets position in sequence from which elements are drawn. Must be less than end position.
      Parameters:
      d -
      Throws:
      IllegalArgumentException - if new start is more than end position
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getMargin

      public Insets getMargin()
      Get the margin around drawing.
      Returns:
      the margin around drawing
    • setMargin

      public void setMargin(Insets insets)
      Sets the margin around drawing, takes effect regardless the border margins.
      Parameters:
      insets -
    • getToolTipText

      public String getToolTipText(MouseEvent event)
      Overrides:
      getToolTipText in class JComponent