public static void main(String[] args) {
   try {
     // The image is loaded either from this
     //   default filename or the first command-
     //   line argument.
     // The second command-line argument specifies
     //   what string will be displayed. The third
     //   specifies at what point in the string the
     //   background color will change.
     String filename = "Raphael.jpg";
     String message = "Java2D";
     int split = 4;
     if (args.length > 0) filename = args[0];
     if (args.length > 1) message = args[1];
     if (args.length > 2) split = Integer.parseInt(args[2]);
     ApplicationFrame f = new ApplicationFrame("ShowOff v1.0");
     f.setLayout(new BorderLayout());
     ShowOff showOff = new ShowOff(filename, message, split);
     f.add(showOff, BorderLayout.CENTER);
     f.setSize(f.getPreferredSize());
     f.center();
     f.setResizable(false);
     f.setVisible(true);
   } catch (Exception e) {
     System.out.println(e);
     System.exit(0);
   }
 }
  public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (isVisible()
        && (e.getSource() == optionPane)
        && (JOptionPane.VALUE_PROPERTY.equals(prop)
            || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
      Object value = optionPane.getValue();

      if (value == JOptionPane.UNINITIALIZED_VALUE) return;
      optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);

      if (button1.equals(value)) {
        try {
          double a = Double.parseDouble(left.getText());
          double b = Double.parseDouble(right.getText());
          double err = Double.parseDouble(error.getText());

          if (a > b) {
            JOptionPane.showMessageDialog(this, "A < B!!!", null, JOptionPane.ERROR_MESSAGE);
          } else {
            hideIt();
            graphic.startApplyingMethod(parentFrame.getSelectedMethod(), err, a, b);
          }
        } catch (Exception ex) {
          JOptionPane.showMessageDialog(
              this, "Trebuie sa fie numar real!", null, JOptionPane.ERROR_MESSAGE);
        }
      } else if (button2.equals(value)) {
        hideIt();
      }
    }
  }
Beispiel #3
0
  /** @return the TrianaClient for the specified task (null if unknown) */
  public static TrianaClient getTrianaClientFor(Task task) {
    TaskGraph parent;

    if (task instanceof TaskGraph) {
      parent = (TaskGraph) task;
    } else {
      parent = task.getParent();
    }

    TrianaClient client = null;

    while ((parent != null) && (client == null)) {
      client = app.getTrianaClient(parent);

      if (client == null) {
        parent = parent.getParent();
      }
    }

    return client;
  }
Beispiel #4
0
 public static DesktopView getDesktopViewFor(TaskGraph group) {
   return app.getDesktopViewFor(group);
 }
Beispiel #5
0
 /** Remove the specified main triana from the workspace */
 public static void removeTaskGraphContainer(DesktopView cont) {
   app.removeDesktopView(cont);
 }
Beispiel #6
0
 public static DesktopView getSelectedDesktopView() {
   return app.getSelectedDesktopView();
 }