static {
   String laf = ConfigurationManager.getGlobalConfiguration().getLookAndFeel();
   LookAndFeelManager.instance().changeTo(laf);
   if (OS.TYPE != OS.Type.WINDOWS) {
     GrabbableViewport.setHandCursorIcon(Icons.getIcon("grabbing"));
   }
 }
Exemple #2
0
 /**
  * Constructor.
  *
  * @param editor
  */
 ExportMapAction(Editor editor) {
   this.editor = editor;
   putValue(Action.NAME, "Export &HTML map file");
   putValue(
       Action.SHORT_DESCRIPTION,
       "Create an HTML file with" + " an image map for the diagram currently being displayed");
   putValue(Action.SMALL_ICON, Icons.getIcon("map"));
 }
 public String getOption(String text, String... options) {
   OptionDialog optionDialog =
       new OptionDialog(this, "Please choose an option", Icons.getIcon("question"), text);
   for (String option : options) {
     optionDialog.addOption(option);
   }
   return optionDialog.getOption();
 }
 public void addAction(String category, Action action, Activator activator) {
   if (action != null) {
     String iconName = (String) action.getValue(Actions.ICON_NAME);
     if (iconName != null) {
       Icon icon = Icons.getIcon(iconName);
       action.putValue(Action.SMALL_ICON, icon);
     }
   }
   JMenuItem item = menuBar.addAction(category, action, -1);
   if (activator != null) {
     registerComponent(item, activator);
   }
 }
 public void help(String title, String path, boolean navigation) {
   for (int i = 0; i < tabbedPane.getTabCount(); i++) {
     if (!(tabbedPane.getComponentAt(i) instanceof Tab)) {
       if (tabbedPane.getTitleAt(i).equals(title)
           || tabbedPane.getTitleAt(i).startsWith(title + "-")) {
         tabbedPane.setSelectedIndex(i);
         return;
       }
     }
   }
   JComponent help;
   if (navigation) {
     help = new AdvancedHelpPanel(getClass().getResource(path), this);
   } else {
     help = new JScrollPane(new HelpPanel(getClass().getResource(path), this).getPane());
   }
   tabbedPane.addTab(help, title, Icons.getIcon("help"));
 }
  @SuppressWarnings("serial")
  public void showUI() {
    setIconImage(Icons.getIcon("icon").getImage());
    fileChooser = new JFileChooser();
    fileChooser.setCurrentDirectory(new File(System.getProperty("user.home")));
    Container pane = getContentPane();
    pane.setLayout(new BorderLayout());

    tabbedPane = new ATabbedPane();
    tabbedPane.addChangeListener(this);
    tabbedPane.addListener(this);

    pane.add(tabbedPane, BorderLayout.CENTER);

    pane.add(toolbar, BorderLayout.NORTH);

    bottomPanel = new JPanel();
    bottomPanel.setLayout(new BorderLayout());

    scalePanel = new ScalePanel(false);
    Dimension spSize = new Dimension(140, 24);

    scalePanel.setMaximumSize(spSize);
    scalePanel.setMinimumSize(spSize);
    scalePanel.setPreferredSize(spSize);

    scalePanel.setOpaque(false);
    addToolbarSeparator();
    toolbar.add(scalePanel);

    registerComponent(scalePanel, nonEmptyDiagramActivator);

    addToolbarSeparator();

    addToToolbar(scalePanel.normalSizeAction, nonEmptyDiagramActivator);
    addToToolbar(scalePanel.fitHeightAction, nonEmptyDiagramActivator);
    addToToolbar(scalePanel.fitWidthAction, nonEmptyDiagramActivator);
    addToToolbar(scalePanel.fitWindowAction, nonEmptyDiagramActivator);

    pane.add(bottomPanel, BorderLayout.SOUTH);

    int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
    int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;

    int width = (int) (0.8 * screenWidth);
    int height = (int) (0.8 * screenHeight);

    int left = (int) (0.1 * screenWidth);
    int top = (int) (0.1 * screenHeight);

    setSize(width, height);
    setLocation(left, top);

    fullScreen = new FullScreen();
    fullScreen.addListener(this);
    LookAndFeelManager.instance().register(fullScreen);

    setJMenuBar(menuBar);
    LookAndFeelManager.instance().register(this);

    // printDialog.loadProfiles();
    ConfigurationManager.getGlobalConfigurationBean()
        .addPropertyChangeListener(
            new PropertyChangeListener() {
              public void propertyChange(PropertyChangeEvent evt) {
                enableComponents();
              }
            });

    enableComponents();
    setVisible(true);
  }
 public void addCategory(String category, String icon) {
   ImageIcon imageIcon = icon == null || icon.equals("") ? null : Icons.getIcon(icon);
   menuBar.addMenu(category, imageIcon);
 }