public void fullScreen() {
   if (fullScreen == null) {
     errorMessage("Full-screen mode is not supported\nby your graphics environment.");
     return;
   }
   Diagram diag = getDiagram();
   if (diag != null) {
     PanelPaintDevice ppd = (PanelPaintDevice) diag.getPaintDevice();
     setVisible(false);
     fullScreen.display(ppd.getPanel());
     fullScreen.getZoomPane().fitSize();
   }
 }
 public void redraw() {
   if (fullScreen.isVisible()) {
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             fullScreen.getContentPane().repaint();
           }
         });
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             fullScreen.getZoomPane().getScrollPane().revalidate();
           }
         });
     return;
   }
   Tab tab = currentTab();
   if (tab != null) {
     tab.redraw();
   }
 }
  @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);
  }