Package jspecview.js2d
Class JsPanel
java.lang.Object
jspecview.js2d.JsPanel
- All Implemented Interfaces:
JSVPanel,JSVViewPanel
The JavaScript extension of a JSVPanel.
- Author:
- Debbie-Ann Facey, Khari A. Bryan, Craig A.D. Walters, Prof Robert J. Lancashire, Bob Hanson hansonr@stolaf.edu
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voiddoRepaint(boolean andTaintAll) static JsPanelgetEmptyPanel(JSViewer viewer) Constructs a new JSVPanelvoidgetFocusNow(boolean asThread) intgetFontFaceID(String name) intstatic JsPanelgetPanelMany(JSViewer viewer, Lst<Spectrum> spectra) Constructs aJSVPanelwith List of spectra and corresponding start and end indices of data points that should be displayedgetTitle()intgetWidth()booleanhasFocus()booleanbooleanbooleanvoidpaintComponent(Object context) Overrides paintComponent in class JPanel in order to draw the spectrumvoidprintPanel(PrintLayout pl, OutputStream os, String title) Send a print job of the spectrum to the default printer on the systemvoidprocessKeyEvent(Object event) booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time) called only by JavaScriptvoidprocessTwoPointGesture(float[][][] touches) voidrepaint()saveImage(String type, GenericFileInterface file, OC out, int width, int height) voidsetBackgroundColor(GenericColor color) voidsetColorOrFont(ColorParameters ds, ScriptToken st) voidsetEnabled(boolean b) voidsetFocusable(boolean b) voidvoidvoidshowMenu(int x, int y) voidshowMessage(String msg, String title) toString()
-
Method Details
-
getApiPlatform
- Specified by:
getApiPlatformin interfaceJSVPanel
-
getPanelData
- Specified by:
getPanelDatain interfaceJSVPanel
-
getEmptyPanel
Constructs a new JSVPanel- Parameters:
viewer-- Returns:
- this
-
getPanelMany
Constructs aJSVPanelwith List of spectra and corresponding start and end indices of data points that should be displayed- Parameters:
viewer-spectra- the List ofGraphinstances- Returns:
- this
-
getTitle
- Specified by:
getTitlein interfaceJSVViewPanel
-
dispose
public void dispose()- Specified by:
disposein interfaceJSVViewPanel
-
setTitle
- Specified by:
setTitlein interfaceJSVViewPanel
-
setColorOrFont
-
setBackgroundColor
- Specified by:
setBackgroundColorin interfaceJSVPanel
-
getInput
-
showMessage
- Specified by:
showMessagein interfaceJSVPanel
-
getFocusNow
public void getFocusNow(boolean asThread) - Specified by:
getFocusNowin interfaceJSVPanel
-
getFontFaceID
- Specified by:
getFontFaceIDin interfaceJSVPanel
-
doRepaint
public void doRepaint(boolean andTaintAll) -
paintComponent
Overrides paintComponent in class JPanel in order to draw the spectrum- Specified by:
paintComponentin interfaceJSVPanel- Parameters:
context- the canvas's context
-
printPanel
Send a print job of the spectrum to the default printer on the system- Specified by:
printPanelin interfaceJSVPanel- Parameters:
pl- the layout of the print jobos-title-
-
saveImage
-
hasFocus
public boolean hasFocus() -
repaint
public void repaint() -
setToolTipText
- Specified by:
setToolTipTextin interfaceJSVPanel
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceJSVViewPanel
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceJSVViewPanel
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceJSVViewPanel
-
isFocusable
public boolean isFocusable()- Specified by:
isFocusablein interfaceJSVViewPanel
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein interfaceJSVViewPanel
-
setEnabled
public void setEnabled(boolean b) - Specified by:
setEnabledin interfaceJSVViewPanel
-
setFocusable
public void setFocusable(boolean b) - Specified by:
setFocusablein interfaceJSVViewPanel
-
toString
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) called only by JavaScript- Specified by:
processMouseEventin interfaceJSVPanel- Parameters:
id-x-y-modifiers-time-- Returns:
- t/f
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches) - Specified by:
processTwoPointGesturein interfaceJSVPanel
-
processKeyEvent
- Specified by:
processKeyEventin interfaceJSVPanel
-
showMenu
public void showMenu(int x, int y)
-