java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.sfc.designer.workspace.GridRuler
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
GridRuler.X, GridRuler.Y

public abstract class GridRuler extends JPanel
Special version of ruler that counts grid cells for SFCs, rather than pixels.
See Also:
  • Constructor Details

  • Method Details

    • offset

      protected abstract int offset(Rectangle r)
      Whats the offset position for the given rectangle in this ruler's dimension? (i.e. for a horizontal ruler it would be r.x)
      Parameters:
      r - The rectangle in question.
    • extent

      protected abstract int extent(Rectangle r)
      Whats the extent of the given rectangle in this ruler's dimension? (i.e. for a horizontal ruler it would be r.width)
      Parameters:
      r - The rectangle in question.
    • inc

      protected abstract int inc(Dimension resolution)
    • minRes

      protected abstract int minRes()
    • paintUnderline

      protected abstract void paintUnderline(Graphics2D g, int start, Rectangle area)
    • paintLabel

      protected abstract void paintLabel(Graphics2D g, int pos, int value, Rectangle area)
      Paint the label (a string representing the ruler value.
      Parameters:
      pos - The position in Java2D space at which to paint the label
      value - The value of the label itself.
    • paintComponent

      protected void paintComponent(Graphics graphics)
      Overrides:
      paintComponent in class JComponent