Current Page: NeXtMidas Training File Handlers Lab 2 Axis Definition Methods
- - | `implements PlotFile`: Since we are now implementing `PlotFiler` we need to add `implements PlotFile` to the top of the class definition.
        public class OrangeFile extends BaseFile implements PlotFile
- - The X-Axis: In Lab 1 we implemented `getXStart()` and `getXDelta()`, now we need to add `getXUnits()` and `getXFrame()`. `getXUnits()` is looking for the units associated with the X-axis (`PLOT` uses this for the axis title). Since an ORANGE file does not have any units specified, we can just return `Units.NONE`. `getXFrame()` gives the frame size for a 2D file. In our case we have 1D data so the x-axis frame size is 1. The Y-Axis: Since we only have 1D data, there is no Y-axis to speak of. So we are just going to return the default values for everything.
          public double getYStart () { return 0.0; }
          public double getYDelta () { return 1.0; }
          public int    getYUnits () { return Units.NONE; }
          public int    getYFrame () { return 1;   }
- - The "Primary" Axis: The "primary" axis is just the main axis. Most of the time this is the X-axis, except in the case of 2D data where the Y-axis is used.
          public double getStart () { return getXStart(); }
          public double getDelta () { return getXDelta(); }
          public int    getUnits () { return getXUnits(); }
          public int    getFrame () { return getXFrame(); }
continued on next page