Class PanelData

java.lang.Object
jspecview.common.PanelData
All Implemented Interfaces:
EventManager

public class PanelData extends Object implements EventManager
JSVPanel class draws a plot from the data contained a instance of a Graph.
Author:
Debbie-Ann Facey, Khari A. Bryan, Craig A.D. Walters, Prof Robert J. Lancashire, Bob Hanson hansonr@stolaf.edu
  • Field Details

    • g2d

      public GenericGraphics g2d
    • g2d0

      public GenericGraphics g2d0
    • options

      public Hashtable<ScriptToken,Object> options
    • jsvp

      public JSVPanel jsvp
    • graphSets

      public Lst<jspecview.common.GraphSet> graphSets
    • currentSplitPoint

      public int currentSplitPoint
    • thisWidget

      public jspecview.common.PlotWidget thisWidget
    • coordClicked

      public Coordinate coordClicked
    • coordsClicked

      public Coordinate[] coordsClicked
    • defaultPrintHeight

      public static final int defaultPrintHeight
      See Also:
    • defaultPrintWidth

      public static final int defaultPrintWidth
      See Also:
    • topMargin

      public static final int topMargin
      See Also:
    • bottomMargin

      public static final int bottomMargin
      See Also:
    • leftMargin

      public static final int leftMargin
      See Also:
    • rightMargin

      public static final int rightMargin
      See Also:
    • ctrlPressed

      public boolean ctrlPressed
    • shiftPressed

      public boolean shiftPressed
    • drawXAxisLeftToRight

      public boolean drawXAxisLeftToRight
    • isIntegralDrag

      public boolean isIntegralDrag
    • xAxisLeftToRight

      public boolean xAxisLeftToRight
    • scalingFactor

      public int scalingFactor
    • integralShiftMode

      public int integralShiftMode
    • left

      public int left
    • coordStr

      public String coordStr
    • startupPinTip

      public String startupPinTip
    • title

      public String title
    • thisWidth

      public int thisWidth
    • isPrinting

      public boolean isPrinting
    • printingFontName

      public String printingFontName
    • printGraphPosition

      public String printGraphPosition
    • titleDrawn

      public boolean titleDrawn
    • display1D

      public boolean display1D
    • isLinked

      public boolean isLinked
    • printJobTitle

      public String printJobTitle
    • spectra

      public Lst<Spectrum> spectra
    • gridOn

      public boolean gridOn
    • titleOn

      public boolean titleOn
    • peakTabsOn

      public boolean peakTabsOn
    • mouseX

      public int mouseX
    • mouseY

      public int mouseY
    • xPixelClicked

      public int xPixelClicked
    • coordinatesColor

      public GenericColor coordinatesColor
    • gridColor

      public GenericColor gridColor
    • integralPlotColor

      public GenericColor integralPlotColor
    • peakTabColor

      public GenericColor peakTabColor
    • plotAreaColor

      public GenericColor plotAreaColor
    • scaleColor

      public GenericColor scaleColor
    • titleColor

      public GenericColor titleColor
    • unitsColor

      public GenericColor unitsColor
    • highlightColor

      public GenericColor highlightColor
    • zoomBoxColor

      public GenericColor zoomBoxColor
    • zoomBoxColor2

      public GenericColor zoomBoxColor2
    • BLACK

      public GenericColor BLACK
    • bgcolor

      public GenericColor bgcolor
    • optionsSaved

      public Hashtable<ScriptToken,Object> optionsSaved
  • Constructor Details

  • Method Details

    • addListener

      public void addListener(PanelListener listener)
    • getCurrentGraphSet

      public jspecview.common.GraphSet getCurrentGraphSet()
    • dispose

      public void dispose()
    • setViewTitle

      public void setViewTitle(String title)
    • getViewTitle

      public String getViewTitle()
    • getInfo

      public Map<String,Object> getInfo(boolean selectedOnly, String key)
    • setBooleans

      public void setBooleans(Parameters parameters, ScriptToken st)
    • setBoolean

      public void setBoolean(ScriptToken st, boolean isTrue)
    • getBoolean

      public boolean getBoolean(ScriptToken st)
    • setFontName

      public void setFontName(ScriptToken st, String fontName)
    • getDisplay1D

      public boolean getDisplay1D()
    • setTaintedAll

      public void setTaintedAll()
    • initOne

      public void initOne(Spectrum spectrum)
    • initMany

      public void initMany(Lst<Spectrum> spectra, int startIndex, int endIndex)
    • findMatchingPeakInfo

      public PeakInfo findMatchingPeakInfo(PeakInfo pi)
    • integrateAll

      public void integrateAll(ColorParameters parameters)
    • getNumberOfGraphSets

      public int getNumberOfGraphSets()
      Returns the Number of Graph sets
      Returns:
      the Number of graph sets
    • getTitle

      public String getTitle()
      Returns the title displayed on the graph
      Returns:
      the title displayed on the graph
    • refresh

      public void refresh()
    • addAnnotation

      public void addAnnotation(Lst<String> tokens)
    • addPeakHighlight

      public void addPeakHighlight(PeakInfo peakInfo)
    • selectPeakByFileIndex

      public PeakInfo selectPeakByFileIndex(String filePath, String index, String atomKey)
    • setPlotColors

      public void setPlotColors(GenericColor[] colors)
    • selectSpectrum

      public void selectSpectrum(String filePath, String type, String model, boolean andCurrent)
    • hasFileLoaded

      public boolean hasFileLoaded(String filePath)
    • clearAllView

      public void clearAllView()
      Clears all views in the zoom list
    • drawGraph

      public void drawGraph(Object gMain, Object gFront, Object gRear, int width, int height, boolean addFilePath)
      Draws the Spectrum to the panel
      Parameters:
      gMain - the main Graphics object
      gFront - the Graphics object for top-object writing
      gRear -
      width - the width to be drawn in pixels
      height - the height to be drawn in pixels
      addFilePath -
    • drawCoordinates

      public void drawCoordinates(Object g, int top, int x, int y)
      Parameters:
      g -
      top -
      x -
      y -
    • setFont

      public Font setFont(Object g, int width, int style, float size, boolean isLabel)
    • printFilePath

      public void printFilePath(Object g, int x, int y, String s)
    • printVersion

      public void printVersion(Object g, int pageHeight)
    • drawTitle

      public void drawTitle(Object g, int pageHeight, int pageWidth, String title)
      Draws Title
      Parameters:
      g -
      pageHeight - the height to be drawn in pixels -- after scaling
      pageWidth - the width to be drawn in pixels -- after scaling
      title -
    • selectFromEntireSet

      public void selectFromEntireSet(int iSpec)
      sets bsSelected to the specified pointer from "select 3.1*1"
      Parameters:
      iSpec -
    • addToList

      public void addToList(int iSpec, Lst<Spectrum> list)
    • scaleSelectedBy

      public void scaleSelectedBy(double f)
    • jumpToSpectrum

      public void jumpToSpectrum(Spectrum spec)
    • jumpToSpectrumIndex

      public void jumpToSpectrumIndex(int index, boolean doSetSpec)
    • splitStack

      public void splitStack(boolean doSplit)
    • getNumberOfSpectraInCurrentSet

      public int getNumberOfSpectraInCurrentSet()
    • getSourceID

      public String getSourceID()
    • getStartingPointIndex

      public int getStartingPointIndex(int index)
    • getEndingPointIndex

      public int getEndingPointIndex(int index)
    • haveSelectedSpectrum

      public boolean haveSelectedSpectrum()
    • getShowAnnotation

      public boolean getShowAnnotation(Annotation.AType type)
    • showAnnotation

      public void showAnnotation(Annotation.AType type, Boolean tfToggle)
    • setYStackOffsetPercent

      public void setYStackOffsetPercent(int offset)
    • setSpectrum

      public void setSpectrum(int iSpec, boolean isSplit)
    • getSpectrum

      public Spectrum getSpectrum()
    • setSpecForIRMode

      public void setSpecForIRMode(Spectrum spec)
    • isShowAllStacked

      public boolean isShowAllStacked()
    • getCurrentSpectrumIndex

      public int getCurrentSpectrumIndex()
    • getSpectrumAt

      public Spectrum getSpectrumAt(int index)
    • addHighlight

      public void addHighlight(jspecview.common.GraphSet gs, double x1, double x2, Spectrum spec, int r, int g, int b, int a)
      Add information about a region of the displayed spectrum to be highlighted applet only right now
      Parameters:
      gs -
      x1 - the x value of the coordinate where the highlight should start
      x2 - the x value of the coordinate where the highlight should end
      spec -
      r -
      g -
      b -
      a -
    • removeHighlight

      public void removeHighlight(double x1, double x2)
      Remove the highlight specified by the starting and ending x value
      Parameters:
      x1 - the x value of the coordinate where the highlight started
      x2 - the x value of the coordinate where the highlight ended
    • removeAllHighlights

      public void removeAllHighlights()
      Removes all highlights from the display
    • setZoom

      public void setZoom(double x1, double y1, double x2, double y2)
    • resetView

      public void resetView()
      Resets the spectrum to it's original view
    • previousView

      public void previousView()
      Displays the previous view zoomed
    • nextView

      public void nextView()
      Displays the next view zoomed
    • getSelectedIntegral

      public Integral getSelectedIntegral()
    • advanceSubSpectrum

      public void advanceSubSpectrum(int dir)
    • setSelectedIntegral

      public void setSelectedIntegral(double val)
    • scaleYBy

      public void scaleYBy(double f)
    • toPeak

      public void toPeak(int i)
    • getClickedCoordinate

      public Coordinate getClickedCoordinate()
      Returns the spectrum coordinate of the point on the display that was clicked
      Returns:
      the spectrum coordinate of the point on the display that was clicked
    • getPickedCoordinates

      public boolean getPickedCoordinates(Coordinate coord, Coordinate actualCoord)
      click event processing
      Parameters:
      coord -
      actualCoord -
      Returns:
      true if a coordinate was picked and fills in coord and actualCoord
    • shiftSpectrum

      public boolean shiftSpectrum(int mode, double xOld, double xNew)
      shifts xyCoords for a spectrum by the specified amount
      Parameters:
      mode -
      xOld - old position or NaN
      xNew - NaN or new position
      Returns:
      true if successful
    • findX

      public void findX(Spectrum spec, double d)
    • setXPointers

      public void setXPointers(Spectrum spec, double x1, Spectrum spec2, double x2)
    • isCurrentGraphSet

      public boolean isCurrentGraphSet(jspecview.common.GraphSet graphSet)
    • repaint

      public void repaint()
    • setToolTipText

      public void setToolTipText(String s)
    • setHighlightColor

      public void setHighlightColor(GenericColor color)
    • notifySubSpectrumChange

      public void notifySubSpectrumChange(int isub, Spectrum spec)
      Parameters:
      isub - -1 indicates direction if no subspectra or subspectrum index if subspectra
      spec - null indicates no subspectra
    • notifyPeakPickedListeners

      public void notifyPeakPickedListeners(PeakPickEvent p)
      Notifies CoordinatePickedListeners
      Parameters:
      p -
    • notifyListeners

      public void notifyListeners(Object eventObj)
    • escapeKeyPressed

      public void escapeKeyPressed(boolean isDEL)
    • hasFocus

      public boolean hasFocus()
    • isMouseUp

      public boolean isMouseUp()
    • doMouseMoved

      public void doMouseMoved(int xPixel, int yPixel)
    • doMousePressed

      public void doMousePressed(int xPixel, int yPixel)
    • doMouseDragged

      public void doMouseDragged(int xPixel, int yPixel)
    • doMouseReleased

      public void doMouseReleased(int xPixel, int yPixel, boolean isButton1)
    • doMouseClicked

      public void doMouseClicked(int xPixel, int yPixel, boolean isControlDown)
    • hasCurrentMeasurements

      public boolean hasCurrentMeasurements(Annotation.AType type)
    • getDialog

      public AnnotationData getDialog(Annotation.AType type)
    • addDialog

      public void addDialog(int iSpec, Annotation.AType type, AnnotationData dialog)
    • getPeakListing

      public void getPeakListing(Parameters p, Boolean tfToggle)
    • checkIntegral

      public void checkIntegral(Parameters parameters, String value)
    • setIntegrationRatios

      public void setIntegrationRatios(String value)
      DEPRECATED Sets the integration ratios that will be displayed
      Parameters:
      value -
    • getView

      public ScaleData getView()
    • closeAllDialogsExcept

      public void closeAllDialogsExcept(Annotation.AType type)
    • removeDialog

      public void removeDialog(JSVDialog dialog)
    • normalizeIntegral

      public void normalizeIntegral()
    • getDrawTitle

      public String getDrawTitle(boolean isPrinting)
    • getPrintJobTitle

      public String getPrintJobTitle(boolean isPrinting)
    • linkSpectra

      public void linkSpectra(PanelData.LinkMode mode)
    • doZoomLinked

      public void doZoomLinked(jspecview.common.GraphSet graphSet, double initX, double finalX, boolean addZoom, boolean checkRange, boolean is1d)
    • clearLinkViews

      public void clearLinkViews(jspecview.common.GraphSet graphSet)
    • setlinkedXMove

      public void setlinkedXMove(jspecview.common.GraphSet graphSet, double x, boolean isX2)
    • set2DCrossHairsLinked

      public void set2DCrossHairsLinked(jspecview.common.GraphSet graphSet, double x, double y, boolean isLocked)
    • dialogsToFront

      public void dialogsToFront(Spectrum spec)
    • setColor

      public void setColor(ScriptToken st, GenericColor color)
    • getColor

      public GenericColor getColor(ScriptToken whatColor)
    • getOverlayLegendData

      public Object[][] getOverlayLegendData()
    • setColorOrFont

      public void setColorOrFont(ColorParameters params, ScriptToken st)
    • getCurrentPlotColor

      public GenericColor getCurrentPlotColor(int i)
    • setPrint

      public void setPrint(PrintLayout pl, String fontName)
    • setDefaultPrintOptions

      public void setDefaultPrintOptions(PrintLayout pl)
    • showDialog

      public JSVDialog showDialog(Annotation.AType type)
    • printPdf

      public void printPdf(GenericGraphics pdfCreator, PrintLayout pl)
      from jspecview.export.PDFCreator -- does not use iText --
      Parameters:
      pdfCreator -
      pl -
    • print

      public int print(Object g, double height, double width, double x, double y, double paperHeight, double paperWidth, boolean isPortrait, int pi)
    • keyPressed

      public boolean keyPressed(int code, int modifiers)
      Specified by:
      keyPressed in interface EventManager
    • keyReleased

      public void keyReleased(int keyCode)
      Specified by:
      keyReleased in interface EventManager
    • keyTyped

      public boolean keyTyped(int ch, int mods)
      Specified by:
      keyTyped in interface EventManager
    • mouseAction

      public void mouseAction(int mode, long time, int x, int y, int countIgnored, int buttonMods)
      Specified by:
      mouseAction in interface EventManager
    • checkMod

      public boolean checkMod(int buttonMods, int mask)
    • checkKeyControl

      public void checkKeyControl(int keyCode, boolean isPressed)
    • updateControlPressed

      public boolean updateControlPressed(int mods)
    • mouseEnterExit

      public void mouseEnterExit(long time, int x, int y, boolean isExit)
      Specified by:
      mouseEnterExit in interface EventManager
    • setSolutionColor

      public void setSolutionColor(String what)
    • setIRMode

      public void setIRMode(Spectrum.IRMode mode, String type)
    • closeSpectrum

      public void closeSpectrum()