Example #1
0
 public int getWidth() {
   float fWidth;
   int width;
   fWidth = scale * nativeGetMaxWidth();
   width = Math.round(fWidth);
   if (parentContainer == null) {
     return width;
   } else {
     return FTAUtilities.max(width, parentContainer.getWidth());
   }
 }
Example #2
0
 public int getHeight() {
   float fHeight;
   int height;
   fHeight = scale * nativeGetMaxDepth();
   height = Math.round(fHeight) + (2 * margin);
   if (parentContainer == null) {
     return height;
   } else {
     return FTAUtilities.max(height, parentContainer.getHeight());
   }
 }
Example #3
0
  private void initialise() {
    setSize(180, 120);
    setLocation(300, 200);
    setTitle("Working...");
    setVisible(false);
    setModal(true);
    setResizable(false);
    setDefaultCloseOperation(0);
    _stopped = false;
    getContentPane().setLayout(new BorderLayout());

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

    busyTextLabel = new JLabel("Busy - please wait");
    topPanel.add(busyTextLabel, "Center");

    busyIcon = FTAUtilities.loadImageIcon("busy.gif");
    busyIconLabel = new JLabel(busyIcon);
    topPanel.add(busyIconLabel, "West");

    progressBar = new JProgressBar();
    topPanel.add(progressBar, "South");

    getContentPane().add(topPanel);

    stopButton = new JButton("Stop");
    stopButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // System.out.println("'Stop' button pressed");
            _stopped = true;
          }
        });
    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            _stopped = true;
          }
        });

    // create panel to hold buttons
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(stopButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);
  }