@Override
 public void setLabels() {
   super.setLabels();
   Localization loc = app.getLocalization();
   getLabel().setText(loc.getPlain("AnimationSpeed") + ":");
   modeLabel.setText(loc.getPlain("Repeat") + ": ");
 }
 /** Set the tool tip texts (used for language change, and at initialization labels). */
 public void setLabels() {
   btnColumns.setToolTipText(loc.getMenuTooltip("Columns"));
   btnOptions.setToolTipText(loc.getMenuTooltip("Options"));
   btnExport.setToolTipText(loc.getPlainTooltip("ExportAsWebpage"));
   btnPrint.setToolTipText(loc.getMenuTooltip("Print"));
   btnHelp.setToolTipText(loc.getMenuTooltip("FastHelp"));
   miShowOnlyBreakpoints.setText(loc.getPlain("ShowOnlyBreakpoints"));
   miColorfulConstructionProtocol.setText(loc.getPlain("ColorfulConstructionProtocol"));
 }
Example #3
0
 /**
  * @param app
  * @param type
  * @return short version of Option type string
  */
 public static final String getTypeStringSimple(Localization loc, OptionType type) {
   switch (type) {
     case DEFAULTS:
       return loc.getPlain("Defaults");
     case SPREADSHEET:
       return loc.getPlain("Spreadsheet");
     case EUCLIDIAN:
       return loc.getPlain("DrawingPad");
     case EUCLIDIAN2:
       return loc.getPlain("DrawingPad2");
     case CAS:
       return loc.getPlain("CAS");
     case ADVANCED:
       return loc.getMenu("Advanced");
     case OBJECTS:
       return loc.getMenu("Objects");
       // return objectPanel.getSelectionDescription();
     case LAYOUT:
       return loc.getMenu("Layout");
     case EUCLIDIAN3D:
       return loc.getPlain("GraphicsView3D");
     case EUCLIDIAN_FOR_PLANE:
       return loc.getPlain("ExtraViews");
     case ALGEBRA:
       return loc.getPlain("Algebra");
     default:
       Log.error("missing case in getTypeStringSimple():" + type);
       return null;
   }
 }
Example #4
0
  @Override
  public void setLabels() {
    getLabel().setText(loc.getPlain(getTitle()) + ":");

    int idx = getListBox().getSelectedIndex();
    getListBox().clear();
    getMultipleModel().fillModes(loc);
    getListBox().setSelectedIndex(idx);
  }
Example #5
0
 private void setLabels() {
   btnOK.setText(okLabel == null ? loc.getPlain("OK") : okLabel);
   btnCancel.setText(loc.getPlain("Cancel"));
 }
  /** add the buttons */
  protected void addButtons() {

    // "columns" button

    btnColumns =
        new PopupMenuButtonD(app) {

          private static final long serialVersionUID = 1L;

          @Override
          public boolean prepareToShowPopup() {
            JCheckBoxMenuItem item;
            removeAllMenuItems();
            for (int k = 1; k < cpView.getTableColumns().length; k++) {
              item = new JCheckBoxMenuItem(cpView.getData().getColumns()[k].getTranslatedTitle());
              TableColumn column = cpView.getTableColumns()[k];
              item.setSelected(cpView.isColumnInModel(column));
              ColumnKeeper colKeeper = cpView.new ColumnKeeper(column, cpView.getData().columns[k]);
              item.addActionListener(colKeeper);
              btnColumns.addPopupMenuItem(item);
            }

            return true;
          }
        };
    btnColumns.setKeepVisible(true);
    btnColumns.setStandardButton(true); // mouse clicks over total button
    // region
    btnColumns.setIcon(app.getScaledIcon(GuiResourcesD.COLUMN_HEADER));

    add(btnColumns);

    addSeparator();

    // options button
    // PopupMenuButton without selection table, add JMenuItems directly.

    btnOptions =
        new PopupMenuButtonD(app) {

          private static final long serialVersionUID = 1L;

          @Override
          public boolean prepareToShowPopup() {
            miShowOnlyBreakpoints.setSelected(
                app.getKernel().getConstruction().showOnlyBreakpoints());
            miColorfulConstructionProtocol.setSelected(cpView.getUseColors());
            return true;
          }
        };
    btnOptions.setKeepVisible(true);
    btnOptions.setStandardButton(true); // mouse clicks over total button
    // region
    btnOptions.setIcon(app.getScaledIcon(GuiResourcesD.DOCUMENT_PROPERTIES));

    miShowOnlyBreakpoints = new JCheckBoxMenuItem(loc.getPlain("ShowOnlyBreakpoints"));
    miShowOnlyBreakpoints.setSelected(app.getKernel().getConstruction().showOnlyBreakpoints());
    miShowOnlyBreakpoints.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            cpView.showOnlyBreakpointsAction();
          }
        });
    btnOptions.addPopupMenuItem(miShowOnlyBreakpoints);

    miColorfulConstructionProtocol =
        new JCheckBoxMenuItem(loc.getPlain("ColorfulConstructionProtocol"));
    miColorfulConstructionProtocol.setSelected(cpView.getUseColors());
    miColorfulConstructionProtocol.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            cpView.setUseColors(!cpView.getUseColors());
          }
        });
    btnOptions.addPopupMenuItem(miColorfulConstructionProtocol);
    add(btnOptions);

    addSeparator();

    // export button

    btnExport = new JButton(app.getScaledIcon(GuiResourcesD.TEXT_HTML));
    btnExport.setToolTipText(loc.getPlainTooltip("ExportAsWebpage"));
    btnExport.addActionListener(this);
    add(btnExport);

    addSeparator();

    // print button
    btnPrint = new JButton(app.getScaledIcon(GuiResourcesD.DOCUMENT_PRINT_PREVIEW));
    btnPrint.setToolTipText(loc.getPlainTooltip("Print"));
    btnPrint.addActionListener(this);
    add(btnPrint);

    addSeparator();

    // Help button
    btnHelp = new JButton(app.getScaledIcon(GuiResourcesD.HELP));
    // btnHelp.setToolTipText(loc.getPlainTooltip("FastHelp"));
    btnHelp.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Thread runner =
                new Thread() {
                  @Override
                  public void run() {
                    app.getGuiManager().openHelp("Construction_Protocol");
                  }
                };
            runner.start();
          }
        });
    add(btnHelp);

    setLabels();
  }
Example #7
0
 public String getTypeString(OptionType type) {
   switch (type) {
     case DEFAULTS:
       return loc.getPlain("PreferencesOfA", loc.getPlain("Defaults"));
     case SPREADSHEET:
       return loc.getPlain("PreferencesOfA", loc.getPlain("Spreadsheet"));
     case EUCLIDIAN:
       return loc.getPlain("PreferencesOfA", loc.getPlain("DrawingPad"));
     case EUCLIDIAN2:
       return loc.getPlain("PreferencesOfA", loc.getPlain("DrawingPad2"));
     case EUCLIDIAN_FOR_PLANE:
       return loc.getPlain("PreferencesOfA", loc.getPlain("ExtraViews"));
     case EUCLIDIAN3D:
       return loc.getPlain("PreferencesOfA", loc.getPlain("GraphicsView3D"));
     case CAS:
       return loc.getPlain("PreferencesOfA", loc.getPlain("CAS"));
     case ADVANCED:
       return loc.getPlain("PreferencesOfA", loc.getMenu("Advanced"));
     case ALGEBRA:
       return loc.getPlain("PreferencesOfA", loc.getPlain("Algebra"));
     case OBJECTS:
       return objectPanel == null ? loc.getMenu("Objects") : objectPanel.getSelectionDescription();
     case LAYOUT:
       return loc.getPlain("PreferencesOfA", loc.getMenu("Layout"));
   }
   return null;
 }