コード例 #1
0
  /** Creates a new instance of <code>InstrumentsDbPane</code> */
  public InstrumentsDbPane() {
    setLayout(new BorderLayout());
    if (SHF.getInstrumentsDbTreeModel() != null) {
      instrumentsDbTree = new FantasiaInstrumentsDbTree(SHF.getInstrumentsDbTreeModel());
    } else {
      instrumentsDbTree = new FantasiaInstrumentsDbTree(new InstrumentsDbTreeModel(true));
    }

    instrumentsTable = new JSInstrumentsDbTable(instrumentsDbTree, "InstrumentsDbPane.");
    instrumentsTable.getModel().setShowDummyColumn(true);
    instrumentsTable.loadColumnsVisibleState();
    instrumentsTable.loadColumnWidths();
    instrumentsTable.loadSortOrder();

    instrumentsDbTree.setSelectedDirectory("/");

    JScrollPane sp1 = new JScrollPane(instrumentsDbTree);
    sp1.setPreferredSize(new Dimension(200, 200));
    JScrollPane sp2 = new JScrollPane(instrumentsTable);
    sp2.setPreferredSize(new Dimension(200, 200));
    sp2.setOpaque(false);
    sp2.getViewport().setOpaque(false);

    splitPane =
        new JSplitPane(
            JSplitPane.VERTICAL_SPLIT,
            true, // continuousLayout
            sp1,
            sp2);

    splitPane.setResizeWeight(0.4);

    add(splitPane);
    add(new ToolBar(), BorderLayout.NORTH);

    int i = preferences().getIntProperty("InstrumentsDbPane.splitDividerLocation", 160);
    splitPane.setDividerLocation(i);
  }
コード例 #2
0
  /** Creates a new instance of <code>InstrumentsDbFrame</code> */
  public InstrumentsDbFrame() {
    setTitle(i18n.getLabel("InstrumentsDbFrame.title"));
    if (Res.appIcon != null) setIconImage(Res.appIcon.getImage());

    instrumentsDbTree = new JSInstrumentsDbTree(SHF.getInstrumentsDbTreeModel());

    sidePane = new SidePane();
    mainPane = new MainPane();

    instrumentsDbTree.setSelectedDirectory("/");

    toolbar = new ToolBar();
    getContentPane().add(toolbar, BorderLayout.NORTH);

    splitPane =
        new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            true, // continuousLayout
            sidePane,
            mainPane);

    splitPane.setDividerSize(3);
    splitPane.setDividerLocation(200);

    addMenu();

    pack();
    setSavedSize();

    getContentPane().add(splitPane);
    mainPane.getInstrumentsTable().loadColumnWidths();

    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent we) {
            onWindowClose();
          }
        });

    installKeyboardListeners();
  }
コード例 #3
0
 PreferencesDlg() {
   super(SHF.getMainFrame(), instrumentsTable);
 }