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 one or more
GraphSet objects.
A graph set includes one or more spectra of the same type -- 13C or 1H, for
example. These are linked so that their expansions synchronize and, if linked
to a 2D spectrum, so that their cursors reflect the cross-hairs of the 2D
spectrum.
So there is a stack of graph sets.
The mouse is active only in one of these sets (PanelData.mouseSet), and
within that, a specific spectrum (GraphSet.iSpectrumMovedTo). Clicking on the
graph sets these as well- 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 intbooleanintstatic final intstatic final intbooleanLst<jspecview.common.GraphSet> booleanintbooleanbooleanintstatic final intintintbooleanintstatic final intintbooleanjspecview.common.PlotWidgetbooleanstatic final intbooleanbooleanint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(Lst<String> tokens) voidaddDialog(int iSpec, Annotation.AType type, AnnotationData dialog) voidaddHighlight(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 nowvoidaddListener(PanelListener listener) voidaddPeakHighlight(PeakInfo peakInfo) voidvoidadvanceSubSpectrum(int dir) voidcheckIntegral(Parameters parameters, String value) voidcheckKeyControl(int keyCode, boolean isPressed) booleancheckMod(int buttonMods, int mask) voidClears all views in the zoom listvoidclearLinkViews(jspecview.common.GraphSet graphSet) voidclearMouseSet(jspecview.common.GraphSet gs) voidvoidvoiddialogsToFront(Spectrum spec) voiddispose()voiddoMouseClicked(int xPixel, int yPixel, boolean isControlDown) voiddoMouseDragged(int xPixel, int yPixel) voiddoMouseMoved(int xPixel, int yPixel) voiddoMousePressed(int xPixel, int yPixel) voiddoMouseReleased(int xPixel, int yPixel, boolean isButton1) voiddoZoomLinked(jspecview.common.GraphSet graphSet, double initX, double finalX, boolean addZoom, boolean checkRange, boolean is1d) voiddrawCoordinates(Object g, int top, int x, int y) voiddrawGraph(Object gMain, Object gFront, Object gRear, int width, int height, boolean addFilePath, boolean addBorder) Draws the Spectrum to the panelvoidDraws TitlevoidescapeKeyPressed(boolean isDEL) voidbooleanReturns the spectrum coordinate of the point on the display that was clickedgetColor(ScriptToken whatColor) jspecview.common.GraphSetgetCurrentPlotColor(int i) intgetDialog(Annotation.AType type) booleangetDrawTitle(boolean isPrinting, int iSpec) intgetEndingPointIndex(int index) intReturns the Number of Graph setsintObject[][]voidgetPeakListing(Parameters p, Boolean tfToggle) booleangetPickedCoordinates(Coordinate coord, Coordinate actualCoord) click event processingbooleangetSpectrumAt(int index) intgetStartingPointIndex(int index) getTitle()Returns the title displayed on the graphgetView()booleanbooleanhasFileLoaded(String filePath) booleanhasFocus()booleanvoidvoidbooleanisCurrentGraphSet(jspecview.common.GraphSet graphSet) booleanbooleanvoidjumpToSpectrum(Spectrum spec) voidjumpToSpectrumIndex(int index, boolean doSetSpec) booleankeyPressed(int code, int modifiers) voidkeyReleased(int keyCode) booleankeyTyped(int ch, int mods) voidvoidmouseAction(int mode, long time, int x, int y, int countIgnored, int buttonMods) voidmouseEnterExit(long time, int x, int y, boolean isExit) voidnextView()Displays the next view zoomedvoidvoidnotifyListeners(Object eventObj) voidNotifies CoordinatePickedListenersvoidnotifySubSpectrumChange(int isub, Spectrum spec) voidDisplays the previous view zoomedintprint(Object g, double height, double width, double x, double y, double paperHeight, double paperWidth, boolean isPortrait, int pageIndex) voidprintFilePath(Object g, int x, int y, String s) voidprintPdf(GenericGraphics pdfCreator, PrintLayout pl) from jspecview.export.PDFCreator -- does not use iText --voidprintVersion(Object g, int pageHeight) voidrefresh()voidRemoves all highlights from the displayvoidremoveDialog(JSVDialog dialog) voidremoveHighlight(double x1, double x2) Remove the highlight specified by the starting and ending x valuevoidrepaint()voidResets the spectrum to it's original viewvoidscaleSelectedBy(double f) voidscaleYBy(double f) voidselectFromEntireSet(int iSpec) sets bsSelected to the specified pointer from "select 3.1*1"selectPeakByFileIndex(String filePath, String index, String atomKey) voidselectSpectrum(String filePath, String type, String model, boolean andCurrent) voidset2DCrossHairsLinked(jspecview.common.GraphSet graphSet, double x, double y, boolean isLocked) voidsetBoolean(ScriptToken st, boolean isTrue) voidsetColor(ScriptToken st, GenericColor color) voidsetColorOrFont(ColorParameters params, ScriptToken st) voidvoidsetHighlightColor(GenericColor color) voidsetIntegrationRatios(String value) DEPRECATED Sets the integration ratios that will be displayedvoidsetIRMode(Spectrum.IRMode mode, String type) voidsetlinkedXMove(jspecview.common.GraphSet graphSet, double x, boolean isX2) voidsetPlotColors(GenericColor[] colors) voidsetPrint(PrintLayout pl, String fontName) voidsetSelectedIntegral(double val) voidsetSolutionColor(String what) voidsetSpecForIRMode(Spectrum spec) voidsetSpectrum(int iSpec, boolean isSplit) voidvoidvoidvoidsetXPointers(Spectrum spec, double x1, Spectrum spec2, double x2) voidsetYStackOffsetPercent(int offset) voidsetZoom(double x1, double y1, double x2, double y2) booleanshiftSpectrum(int mode, double xOld, double xNew) shifts xyCoords for a spectrum by the specified amountvoidshowAnnotation(Annotation.AType type, Boolean tfToggle) showDialog(Annotation.AType type) voidsplitStack(boolean doSplit) voidtoPeak(int i) booleanupdateControlPressed(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
-
isPrinting
public boolean isPrinting -
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
-
peakOverColor
-
plotAreaColor
-
scaleColor
-
titleColor
-
unitsColor
-
highlightColor
-
zoomBoxColor
-
zoomBoxColor2
-
BLACK
-
bgcolor
-
optionsSaved
-
unitsDrawn
public boolean unitsDrawn
-
-
Constructor Details
-
PanelData
-
-
Method Details
-
addListener
-
getCurrentGraphSet
public jspecview.common.GraphSet getCurrentGraphSet() -
dispose
public void dispose() -
setBoolean
-
getBoolean
-
getDisplay1D
public boolean getDisplay1D() -
setTaintedAll
public void setTaintedAll() -
initOne
-
initMany
-
findMatchingPeakInfo
-
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() -
setTitle
-
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, boolean addBorder) Draws the Spectrum to the panel- Parameters:
gMain- the mainGraphicsobjectgFront- theGraphicsobject for top-object writinggRear-width- the width to be drawn in pixelsheight- the height to be drawn in pixelsaddFilePath-addBorder-
-
drawCoordinates
- Parameters:
g-top-x-y-
-
setFont
-
printFilePath
-
printVersion
-
drawTitle
Draws Title- Parameters:
g-y- 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() -
clearMouseSet
public void clearMouseSet(jspecview.common.GraphSet gs) -
doMouseMoved
public void doMouseMoved(int xPixel, int yPixel) -
doMouseClicked
public void doMouseClicked(int xPixel, int yPixel, boolean isControlDown) -
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) -
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
-
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 pageIndex) -
keyPressed
public boolean keyPressed(int code, int modifiers) - Specified by:
keyPressedin interfaceEventManager
-
keyReleased
public void keyReleased(int keyCode) - Specified by:
keyReleasedin interfaceEventManager
-
keyTyped
public boolean keyTyped(int ch, int mods) - Specified by:
keyTypedin interfaceEventManager
-
mouseAction
public void mouseAction(int mode, long time, int x, int y, int countIgnored, int buttonMods) - Specified by:
mouseActionin 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:
mouseEnterExitin interfaceEventManager
-
setSolutionColor
-
setIRMode
-
closeSpectrum
public void closeSpectrum()
-