Clazz.declarePackage ("JSV.js2d");
Clazz.load (["JSV.api.JSVPanel"], "JSV.js2d.JsPanel", ["JSV.common.PanelData", "J.util.JmolFont", "$.Logger"], function () {
c$ = Clazz.decorateAsClass (function () {
this.apiPlatform = null;
this.pd = null;
this.mouse = null;
this.viewer = null;
this.name = null;
Clazz.instantialize (this, arguments);
}, JSV.js2d, "JsPanel", null, JSV.api.JSVPanel);
Clazz.overrideMethod (c$, "finalize", 
function () {
J.util.Logger.info ("JSVPanel " + this + " finalized");
});
Clazz.overrideMethod (c$, "getApiPlatform", 
function () {
return this.apiPlatform;
});
Clazz.overrideMethod (c$, "getPanelData", 
function () {
return this.pd;
});
c$.getPanelOne = $_M(c$, "getPanelOne", 
function (viewer, spectrum) {
var p =  new JSV.js2d.JsPanel (viewer);
p.pd.initOne (spectrum);
return p;
}, "JSV.common.JSViewer,JSV.common.JDXSpectrum");
c$.getPanelMany = $_M(c$, "getPanelMany", 
function (viewer, spectra, startIndex, endIndex) {
var p =  new JSV.js2d.JsPanel (viewer);
p.pd.initMany (spectra, startIndex, endIndex);
return p;
}, "JSV.common.JSViewer,JU.List,~N,~N");
Clazz.makeConstructor (c$, 
($fz = function (viewer) {
this.viewer = viewer;
this.pd =  new JSV.common.PanelData (this, viewer);
this.apiPlatform = viewer.apiPlatform;
this.mouse = this.apiPlatform.getMouseManager (0, this);
}, $fz.isPrivate = true, $fz), "JSV.common.JSViewer");
Clazz.overrideMethod (c$, "getTitle", 
function () {
return this.pd.getTitle ();
});
Clazz.overrideMethod (c$, "dispose", 
function () {
if (this.pd != null) this.pd.dispose ();
this.pd = null;
this.mouse.dispose ();
});
Clazz.overrideMethod (c$, "setTitle", 
function (title) {
this.pd.title = title;
this.name = title;
}, "~S");
$_M(c$, "setColorOrFont", 
function (ds, st) {
this.pd.setColorOrFont (ds, st);
}, "JSV.common.ColorParameters,JSV.common.ScriptToken");
Clazz.overrideMethod (c$, "setBackgroundColor", 
function (color) {
}, "javajs.api.GenericColor");
Clazz.overrideMethod (c$, "getInput", 
function (message, title, sval) {
var ret = null;
{
ret = prompt(message, sval);
}this.getFocusNow (true);
return ret;
}, "~S,~S,~S");
Clazz.overrideMethod (c$, "showMessage", 
function (msg, title) {
J.util.Logger.info (msg);
{
alert(msg);
}this.getFocusNow (true);
}, "~S,~S");
Clazz.overrideMethod (c$, "getFocusNow", 
function (asThread) {
this.pd.dialogsToFront ();
}, "~B");
Clazz.overrideMethod (c$, "getFontFaceID", 
function (name) {
return J.util.JmolFont.getFontFaceID ("SansSerif");
}, "~S");
Clazz.overrideMethod (c$, "doRepaint", 
function (andTaintAll) {
this.pd.taintedAll = new Boolean (this.pd.taintedAll | andTaintAll).valueOf ();
if (!this.pd.isPrinting) this.viewer.requestRepaint ();
}, "~B");
$_M(c$, "paintComponent", 
function (context) {
if (this.viewer == null || this.pd == null || this.pd.graphSets == null || this.pd.isPrinting) return;
var context2 = null;
{
context2 = context.canvas.topLayer.getContext("2d");
}this.pd.drawGraph (context, context2, this.getWidth (), this.getHeight (), false);
this.viewer.repaintDone ();
}, "~O");
Clazz.overrideMethod (c$, "printPanel", 
function (pl, os, title) {
pl.title = title;
}, "JSV.common.PrintLayout,java.io.OutputStream,~S");
Clazz.overrideMethod (c$, "saveImage", 
function (type, file) {
}, "~S,~O");
Clazz.overrideMethod (c$, "hasFocus", 
function () {
return false;
});
Clazz.overrideMethod (c$, "repaint", 
function () {
});
Clazz.overrideMethod (c$, "setToolTipText", 
function (s) {
}, "~S");
Clazz.overrideMethod (c$, "getHeight", 
function () {
return this.viewer.getHeight ();
});
Clazz.overrideMethod (c$, "getWidth", 
function () {
return this.viewer.getWidth ();
});
Clazz.overrideMethod (c$, "isEnabled", 
function () {
return false;
});
Clazz.overrideMethod (c$, "isFocusable", 
function () {
return false;
});
Clazz.overrideMethod (c$, "isVisible", 
function () {
return false;
});
Clazz.overrideMethod (c$, "setEnabled", 
function (b) {
}, "~B");
Clazz.overrideMethod (c$, "setFocusable", 
function (b) {
}, "~B");
Clazz.overrideMethod (c$, "toString", 
function () {
return this.pd.getSpectrumAt (0).toString ();
});
Clazz.overrideMethod (c$, "handleOldJvm10Event", 
function (id, x, y, modifiers, time) {
return this.mouse.handleOldJvm10Event (id, x, y, modifiers, time);
}, "~N,~N,~N,~N,~N");
Clazz.overrideMethod (c$, "processTwoPointGesture", 
function (touches) {
this.mouse.processTwoPointGesture (touches);
}, "~A");
});
