Exemplo n.º 1
0
  public void buildPanel() {
    String path = FileUtil.getLayoutPath(layoutDir, fname);
    if (path == null) {
      Messages.postError("Could not open xml file:" + fname);
      return;
    }
    removeAll();
    try {
      LayoutBuilder.build(pane, vnmrIf, path);
    } catch (Exception e) {
      String strError = "Error building file: " + path;
      Messages.postError(strError);
      Messages.writeStackTrace(e);
      return;
    }

    if (bScrollBar) {
      spane =
          new JScrollPane(
              pane,
              JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
              JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
      add(spane);
    } else {
      spane = null;
      add(pane);
    }
    paramsLayout.preferredLayoutSize(pane);
  }
Exemplo n.º 2
0
  public XMLToolPanel(SessionShare ss, String pname, String fname) {

    this.vnmrIf = (ButtonIF) Util.getViewArea().getDefaultExp();
    this.sshare = ss;
    this.pname = pname;
    this.fname = fname;

    pane = new ParamPanel();
    pane.setPanelFile(fname);
    pane.setPanelName(pname);
    pane.setType(ParamInfo.TOOLPANEL);
    pane.setLayoutName("toolPanels");
    pane.setAttributes(null);

    paramsLayout = new VRubberPanLayout();
    if (!Util.isImagingUser()) paramsLayout.setSquish(1.0);

    DisplayOptions.addChangeListener(this);
    ExpPanel.addStatusListener(this);
    // ExpPanel.addExpListener(this);

    setLayout(new xpPanelLayout());
  } // constructor
Exemplo n.º 3
0
 public void setReferenceSize(int w, int h) {
   paramsLayout.setReferenceSize(w, h);
 }
Exemplo n.º 4
0
 public Dimension getActualSize() {
   return paramsLayout.preferredLayoutSize(this);
 }