Class LayoutEditorViewContext


  • public final class LayoutEditorViewContext
    extends java.lang.Object
    LayoutEditorViewContext is a memo object containing the graphical View context information for a LayoutEditor MVC instance.

    As a memo class, this may contain methods, but the class cannot include references to other classes, and ideally the methods won't use references to other classes. Just data, and operations on that data.

    This should map to a subset of the variables stored and loaded by LayoutEditorXml and the XML Schema for the LayoutEditor element.

    This holds graphical View context information. It should not include Model (e.g. layout hardware, even global values) or Control (e.g. options affecting the operation of the editor) information.

    It's OK for this to hold startup default values for the quantities.

    This may be a temporary class, only existing to help build a better structure into this package.

    • Method Detail

      • setGridSize

        public final int setGridSize​(int newSize)
      • getGridSize

        public final int getGridSize()
        Get the width drawing the grid; 10 is the default/initial value.
        Returns:
        current value
      • getGridSize2nd

        public final int getGridSize2nd()
        Get the width for 2nd drawing of the grid; 10 is the default/initial value.
        Returns:
        current value
      • getMainlineTrackWidth

        public final int getMainlineTrackWidth()
        Get the width for drawing mainline track; 4 is the default/initial value.
        Returns:
        current value
      • setSidelineTrackWidth

        public final void setSidelineTrackWidth​(float width)
        Set the width for sideline track; note that the stored and retrievable value is an integer.
        Parameters:
        width - Value to store; will be cast to (int)
      • getSidelineTrackWidth

        public final int getSidelineTrackWidth()
        Get the width for drawing sideline track; 2 is the default/initial value.
        Returns:
        current value
      • getMainlineBlockWidth

        public final int getMainlineBlockWidth()
        Get the width for drawing mainline Block; 4 is the default/initial value.
        Returns:
        current value
      • setSidelineBlockWidth

        public final void setSidelineBlockWidth​(float width)
        Set the width for sideline Block; note that the stored and retrievable value is an integer.
        Parameters:
        width - Value to store; will be cast to (int)
      • getSidelineBlockWidth

        public final int getSidelineBlockWidth()
        Get the width for drawing sideline Block; 2 is the default/initial value.
        Returns:
        current value
      • getXScale

        public final double getXScale()
        Get the X-axis scaling value; 1.0 is the default/initial value.
        Returns:
        current value
      • setXScale

        public final void setXScale​(double scale)
      • getYScale

        public final double getYScale()
        Get the Y-axis scaling value; 1.0 is the default/initial value.
        Returns:
        current value
      • setYScale

        public final void setYScale​(double scale)