/**
   * Creates new dialog
   *
   * @param app application
   */
  public ToolbarConfigDialog(AppD app) {
    super(app.getFrame(), false);
    this.app = app;

    setTitle(app.getMenu("Toolbar.Customize"));

    // list with panels
    JComboBox switcher = new JComboBox();
    switcher.addItem(new KeyValue(-1, app.getPlain("General")));

    DockPanel[] panels =
        ((LayoutD) ((GuiManagerD) app.getGuiManager()).getLayout()).getDockManager().getPanels();

    for (DockPanel panel : panels) {
      if (panel.hasToolbar()) {
        switcher.addItem(new KeyValue(panel.getViewId(), app.getPlain(panel.getViewTitle())));
      }
    }

    switcher.addActionListener(this); // add at the end to not be notified about items being added

    JPanel switcherPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
    switcherPanel.add(switcher);

    getContentPane().setLayout(new BorderLayout(5, 5));
    getContentPane().add(switcherPanel, BorderLayout.NORTH);
    confPanel = new ToolbarConfigPanel(app);
    getContentPane().add(confPanel, BorderLayout.CENTER);
    getContentPane().add(createButtonPanel(), BorderLayout.SOUTH);

    pack();
    setLocationRelativeTo(app.getFrame());
  }
  public CreateObjectDialog(AppD app, SpreadsheetView view, int objectType) {

    super(app.getFrame(), false, app.getLocalization());
    this.app = app;
    this.objectType = objectType;
    this.table = (MyTableD) view.getSpreadsheetTable();
    cp = table.getCellRangeProcessor();
    selectedCellRanges = table.selectedCellRanges;

    boolean showApply = false;

    createGUI(title, "", false, 16, 1, false, false, false, showApply, DialogType.GeoGebraEditor);

    // this.btCancel.setVisible(false);

    createAdditionalGUI();

    updateGUI();

    isIniting = false;
    setLabels(null);
    // setTitle((String) model.getElementAt(objectType));

    // optionPane.add(inputPanel, BorderLayout.CENTER);
    typeList.setSelectedIndex(objectType);

    wrappedDialog.setResizable(true);
    centerOnScreen();
    btCancel.requestFocus();
    wrappedDialog.pack();
    wrappedDialog.addWindowFocusListener(this);
  }
Beispiel #3
0
 /** @return the JFrame for the api's app */
 public JFrame getAppFrame() {
   return app.getFrame();
 }