Package jspecview.common
Class PanelData
java.lang.Object
jspecview.common.PanelData
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
boolean
int
static final int
static final int
boolean
boolean
Lst
<jspecview.common.GraphSet> boolean
int
boolean
boolean
boolean
int
static final int
int
int
boolean
int
static final int
int
boolean
jspecview.common.PlotWidget
int
boolean
boolean
static final int
boolean
int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(Lst<String> tokens) void
addDialog
(int iSpec, Annotation.AType type, AnnotationData dialog) 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 nowvoid
addListener
(PanelListener listener) void
addPeakHighlight
(PeakInfo peakInfo) void
void
advanceSubSpectrum
(int dir) void
checkIntegral
(Parameters parameters, String value) void
checkKeyControl
(int keyCode, boolean isPressed) boolean
checkMod
(int buttonMods, int mask) void
Clears all views in the zoom listvoid
clearLinkViews
(jspecview.common.GraphSet graphSet) void
void
void
dialogsToFront
(Spectrum spec) void
dispose()
void
doMouseClicked
(int xPixel, int yPixel, boolean isControlDown) void
doMouseDragged
(int xPixel, int yPixel) void
doMouseMoved
(int xPixel, int yPixel) void
doMousePressed
(int xPixel, int yPixel) void
doMouseReleased
(int xPixel, int yPixel, boolean isButton1) void
doZoomLinked
(jspecview.common.GraphSet graphSet, double initX, double finalX, boolean addZoom, boolean checkRange, boolean is1d) void
drawCoordinates
(Object g, int top, int x, int y) void
Draws the Spectrum to the panelvoid
Draws Titlevoid
escapeKeyPressed
(boolean isDEL) void
boolean
Returns the spectrum coordinate of the point on the display that was clickedgetColor
(ScriptToken whatColor) jspecview.common.GraphSet
getCurrentPlotColor
(int i) int
getDialog
(Annotation.AType type) boolean
getDrawTitle
(boolean isPrinting) int
getEndingPointIndex
(int index) int
Returns the Number of Graph setsint
Object[][]
void
getPeakListing
(Parameters p, Boolean tfToggle) boolean
getPickedCoordinates
(Coordinate coord, Coordinate actualCoord) click event processinggetPrintJobTitle
(boolean isPrinting) boolean
getSpectrumAt
(int index) int
getStartingPointIndex
(int index) getTitle()
Returns the title displayed on the graphgetView()
boolean
boolean
hasFileLoaded
(String filePath) boolean
hasFocus()
boolean
void
void
void
integrateAll
(ColorParameters parameters) boolean
isCurrentGraphSet
(jspecview.common.GraphSet graphSet) boolean
boolean
void
jumpToSpectrum
(Spectrum spec) void
jumpToSpectrumIndex
(int index, boolean doSetSpec) boolean
keyPressed
(int code, int modifiers) void
keyReleased
(int keyCode) boolean
keyTyped
(int ch, int mods) void
void
mouseAction
(int mode, long time, int x, int y, int countIgnored, int buttonMods) void
mouseEnterExit
(long time, int x, int y, boolean isExit) void
nextView()
Displays the next view zoomedvoid
void
notifyListeners
(Object eventObj) void
Notifies CoordinatePickedListenersvoid
notifySubSpectrumChange
(int isub, Spectrum spec) void
Displays the previous view zoomedint
print
(Object g, double height, double width, double x, double y, double paperHeight, double paperWidth, boolean isPortrait, int pi) void
printFilePath
(Object g, int x, int y, String s) void
printPdf
(GenericGraphics pdfCreator, PrintLayout pl) from jspecview.export.PDFCreator -- does not use iText --void
printVersion
(Object g, int pageHeight) void
refresh()
void
Removes all highlights from the displayvoid
removeDialog
(JSVDialog dialog) void
removeHighlight
(double x1, double x2) Remove the highlight specified by the starting and ending x valuevoid
repaint()
void
Resets the spectrum to it's original viewvoid
scaleSelectedBy
(double f) void
scaleYBy
(double f) void
selectFromEntireSet
(int iSpec) sets bsSelected to the specified pointer from "select 3.1*1"selectPeakByFileIndex
(String filePath, String index, String atomKey) void
selectSpectrum
(String filePath, String type, String model, boolean andCurrent) void
set2DCrossHairsLinked
(jspecview.common.GraphSet graphSet, double x, double y, boolean isLocked) void
setBoolean
(ScriptToken st, boolean isTrue) void
setBooleans
(Parameters parameters, ScriptToken st) void
setColor
(ScriptToken st, GenericColor color) void
setColorOrFont
(ColorParameters params, ScriptToken st) void
void
setFontName
(ScriptToken st, String fontName) void
setHighlightColor
(GenericColor color) void
setIntegrationRatios
(String value) DEPRECATED Sets the integration ratios that will be displayedvoid
setIRMode
(Spectrum.IRMode mode, String type) void
setlinkedXMove
(jspecview.common.GraphSet graphSet, double x, boolean isX2) void
setPlotColors
(GenericColor[] colors) void
setPrint
(PrintLayout pl, String fontName) void
setSelectedIntegral
(double val) void
setSolutionColor
(String what) void
setSpecForIRMode
(Spectrum spec) void
setSpectrum
(int iSpec, boolean isSplit) void
void
void
setViewTitle
(String title) void
setXPointers
(Spectrum spec, double x1, Spectrum spec2, double x2) void
setYStackOffsetPercent
(int offset) void
setZoom
(double x1, double y1, double x2, double y2) boolean
shiftSpectrum
(int mode, double xOld, double xNew) shifts xyCoords for a spectrum by the specified amountvoid
showAnnotation
(Annotation.AType type, Boolean tfToggle) showDialog
(Annotation.AType type) void
splitStack
(boolean doSplit) void
toPeak
(int i) boolean
updateControlPressed
(int mods)
-
Field Details
-
g2d
-
g2d0
-
options
-
jsvp
-
graphSets
-
currentSplitPoint
public int currentSplitPoint -
thisWidget
public jspecview.common.PlotWidget thisWidget -
coordClicked
-
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 -
right
public int right -
coordStr
-
startupPinTip
-
title
-
thisWidth
public int thisWidth -
isPrinting
public boolean isPrinting -
printingFontName
-
printGraphPosition
-
titleDrawn
public boolean titleDrawn -
display1D
public boolean display1D -
isLinked
public boolean isLinked -
printJobTitle
-
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
-
gridColor
-
integralPlotColor
-
peakTabColor
-
plotAreaColor
-
scaleColor
-
titleColor
-
unitsColor
-
highlightColor
-
zoomBoxColor
-
zoomBoxColor2
-
BLACK
-
bgcolor
-
optionsSaved
-
-
Constructor Details
-
PanelData
-
-
Method Details
-
addListener
-
getCurrentGraphSet
public jspecview.common.GraphSet getCurrentGraphSet() -
dispose
public void dispose() -
setViewTitle
-
getViewTitle
-
getInfo
-
setBooleans
-
setBoolean
-
getBoolean
-
setFontName
-
getDisplay1D
public boolean getDisplay1D() -
setTaintedAll
public void setTaintedAll() -
initOne
-
initMany
-
findMatchingPeakInfo
-
integrateAll
-
getNumberOfGraphSets
public int getNumberOfGraphSets()Returns the Number of Graph sets- Returns:
- the Number of graph sets
-
getTitle
Returns the title displayed on the graph- Returns:
- the title displayed on the graph
-
refresh
public void refresh() -
addAnnotation
-
addPeakHighlight
-
selectPeakByFileIndex
-
setPlotColors
-
selectSpectrum
-
hasFileLoaded
-
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 mainGraphics
objectgFront
- theGraphics
object for top-object writinggRear
-width
- the width to be drawn in pixelsheight
- the height to be drawn in pixelsaddFilePath
-
-
drawCoordinates
- Parameters:
g
-top
-x
-y
-
-
setFont
-
printFilePath
-
printVersion
-
drawTitle
Draws Title- Parameters:
g
-pageHeight
- the height to be drawn in pixels -- after scalingpageWidth
- the width to be drawn in pixels -- after scalingtitle
-
-
selectFromEntireSet
public void selectFromEntireSet(int iSpec) sets bsSelected to the specified pointer from "select 3.1*1"- Parameters:
iSpec
-
-
addToList
-
scaleSelectedBy
public void scaleSelectedBy(double f) -
jumpToSpectrum
-
jumpToSpectrumIndex
public void jumpToSpectrumIndex(int index, boolean doSetSpec) -
splitStack
public void splitStack(boolean doSplit) -
getNumberOfSpectraInCurrentSet
public int getNumberOfSpectraInCurrentSet() -
getSourceID
-
getStartingPointIndex
public int getStartingPointIndex(int index) -
getEndingPointIndex
public int getEndingPointIndex(int index) -
haveSelectedSpectrum
public boolean haveSelectedSpectrum() -
getShowAnnotation
-
showAnnotation
-
setYStackOffsetPercent
public void setYStackOffsetPercent(int offset) -
setSpectrum
public void setSpectrum(int iSpec, boolean isSplit) -
getSpectrum
-
setSpecForIRMode
-
isShowAllStacked
public boolean isShowAllStacked() -
getCurrentSpectrumIndex
public int getCurrentSpectrumIndex() -
getSpectrumAt
-
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 startx2
- the x value of the coordinate where the highlight should endspec
-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 startedx2
- 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
-
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
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
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 NaNxNew
- NaN or new position- Returns:
- true if successful
-
findX
-
setXPointers
-
isCurrentGraphSet
public boolean isCurrentGraphSet(jspecview.common.GraphSet graphSet) -
repaint
public void repaint() -
setToolTipText
-
setHighlightColor
-
notifySubSpectrumChange
- Parameters:
isub
- -1 indicates direction if no subspectra or subspectrum index if subspectraspec
- null indicates no subspectra
-
notifyPeakPickedListeners
Notifies CoordinatePickedListeners- Parameters:
p
-
-
notifyListeners
-
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
-
getDialog
-
addDialog
-
getPeakListing
-
checkIntegral
-
setIntegrationRatios
DEPRECATED Sets the integration ratios that will be displayed- Parameters:
value
-
-
getView
-
closeAllDialogsExcept
-
removeDialog
-
normalizeIntegral
public void normalizeIntegral() -
getDrawTitle
-
getPrintJobTitle
-
linkSpectra
-
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
-
setColor
-
getColor
-
getOverlayLegendData
-
setColorOrFont
-
getCurrentPlotColor
-
setPrint
-
setDefaultPrintOptions
-
showDialog
-
printPdf
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 interfaceEventManager
-
keyReleased
public void keyReleased(int keyCode) - Specified by:
keyReleased
in interfaceEventManager
-
keyTyped
public boolean keyTyped(int ch, int mods) - Specified by:
keyTyped
in interfaceEventManager
-
mouseAction
public void mouseAction(int mode, long time, int x, int y, int countIgnored, int buttonMods) - Specified by:
mouseAction
in interfaceEventManager
-
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 interfaceEventManager
-
setSolutionColor
-
setIRMode
-
closeSpectrum
public void closeSpectrum()
-