Exemple #1
2
  AdminMain() {
    l = new JLabel();
    l.setBounds(10, 20, 1340, 1000);
    l.setBackground(Color.black);
    Font ft = new Font("Arial", Font.BOLD, 30);
    Font ft1 = new Font("Arial", Font.BOLD, 14);
    Font ft2 = new Font("Arial", Font.BOLD, 20);

    f1 = new Frame("Soft Test Management (Beta)");
    f1.setLayout(null);

    l1 = new Label("Test Instructions", l1.CENTER);
    l1.setBounds(10, 20, 1300, 60);
    l1.setForeground(Color.blue);
    l1.setBackground(Color.white);
    l1.setFont(ft);

    l2 = new JLabel("Deletion of Faculty/Students");
    l2.setBounds(20, 30, 1000, 500);
    l2.setBackground(Color.blue);
    l2.setFont(ft2);
    l3 = new JLabel("Test Pattern");
    l3.setBounds(20, 90, 1300, 500);
    l3.setBackground(Color.green);
    l3.setFont(ft2);

    b1 = new JButton("Go !");
    b1.setBounds(300, 220, 120, 30);
    b1.setBackground(Color.white);
    b1.setForeground(Color.blue);
    b1.setFont(ft2);

    b2 = new JButton("Go");
    b2.setBounds(300, 240, 120, 30);
    b2.setBackground(Color.white);
    b2.setForeground(Color.blue);
    b2.setFont(ft2);

    f1.add(l);
    l.add(l1);
    l2.add(b1);
    l.add(l2);
    l3.add(b2);
    l.add(l3);

    b1.addActionListener(this);
    b2.addActionListener(this);

    f1.setVisible(true);
    f1.setSize(1800, 800);
  }
Exemple #2
0
  public static void main(String[] args) {
    Frame f = new Frame("Font Test");
    String abc = "ABCDDFGHIJKLMNOPQRSTUVWXYZ";

    // A-Z를 내용으로 갖는 Label들을 생성한다.
    Label abc1 = new Label(abc);
    Label abc2 = new Label(abc);
    Label abc3 = new Label(abc);
    Label abc4 = new Label(abc);
    Label abc5 = new Label(abc);

    // Serif체이며,크기가 20인 Font
    Font f1 = new Font("Serif", Font.PLAIN, 20); // 보통체
    Font f2 = new Font("Serfit", Font.ITALIC, 20); // 기울임체
    Font f3 = new Font("Serif", Font.BOLD, 20); // 굵은체
    Font f4 = new Font("Serif", Font.BOLD + Font.ITALIC, 20); // 굵은 기울임체

    abc1.setFont(f1); // Label에 새로운 Font를 적용한다.
    abc2.setFont(f2);
    abc3.setFont(f3);
    abc4.setFont(f4);
    f.setBackground(Color.CYAN);
    f.setLayout(new FlowLayout());
    f.add(abc1);
    f.add(abc2);
    f.add(abc3);
    f.add(abc4);
    f.add(abc5);

    f.setSize(400, 300);
    f.setVisible(true);
  }
Exemple #3
0
  public D(String title) {
    super(title);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    int frameWidth = 410;
    int frameHeight = 319;
    setSize(frameWidth, frameHeight);
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (d.width - getSize().width) / 2;
    int y = (d.height - getSize().height) / 2;
    setLocation(x, y);
    setResizable(false);
    Container cp = getContentPane();
    cp.setLayout(null);

    label1.setBounds(8, 8, 275, 76);
    label1.setText("Würfel");
    label1.setAlignment(Label.CENTER);
    label1.setFont(new Font("Dialog", Font.PLAIN, 60));
    cp.add(label1);
    l_1.setBounds(8, 88, 275, 145);
    l_1.setText("");
    l_1.setAlignment(Label.CENTER);
    l_1.setFont(new Font("Dialog", Font.PLAIN, 100));

    cp.add(l_1);
    b_1.setBounds(8, 248, 275, 25);
    b_1.setLabel("Würfeln");
    b_1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            b_1_ActionPerformed(evt);
          }
        });
    cp.add(b_1);
    tf_von.setBounds(336, 80, 49, 25);
    cp.add(tf_von);
    tf_bis.setBounds(336, 120, 49, 25);
    cp.add(tf_bis);
    l_von.setBounds(296, 80, 35, 25);
    l_von.setText("Von:");
    cp.add(l_von);
    l_bis.setBounds(296, 120, 35, 25);
    l_bis.setText("Bis:");
    cp.add(l_bis);
    b_a.setBounds(296, 160, 89, 49);
    b_a.setLabel("Annehmen");
    b_a.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            b_a_ActionPerformed(evt);
          }
        });
    cp.add(b_a);

    setVisible(true);
  }
  public Position() {
    Panel grid_panel = new Panel();

    lat_.setFont(FONT);
    long_.setFont(FONT);
    alt_.setFont(FONT);
    heading_.setFont(FONT);

    setLayout(new GridLayout(1, 4));
    add(lat_);
    add(long_);
    add(heading_);
    add(alt_);
  }
Exemple #5
0
  public UserInfoDialog(Frame parent) {
    super(parent, "Input", true);
    setLayout(null);

    l.setFont(default_font);
    l.setSize(50, 30);
    l.setLocation(30, 50);

    name.setFont(default_font);
    name.setSize(150, 30);
    name.setLocation(90, 50);
    // name.selectAll();

    ok.setFont(default_font);
    ok.setSize(50, 30);
    ok.setLocation(30, 90);

    add(l);
    add(name);
    add(ok);
    ok.addActionListener(this);
    setSize(300, 150);

    Point my_loc = parent.getLocation();
    my_loc.x += 50;
    my_loc.y += 150;
    setLocation(my_loc);
    show();
  }
Exemple #6
0
  public DialogBox(Frame parent, String frametitle, String line1, String line2) {
    super(parent, frametitle, true);

    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    setLayout(gb);

    // line 1
    c.gridy = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    Label line1Label = new Label(line1, Label.CENTER);
    gb.setConstraints(line1Label, c);
    line1Label.setForeground(Color.blue);
    line1Label.setFont(new Font("arial", Font.BOLD | Font.ITALIC, 16));
    add(line1Label);

    // line 2
    c.gridy = 1;
    Label line2Label = new Label(line2, Label.CENTER);
    gb.setConstraints(line2Label, c);
    add(line2Label);

    // Button
    c.gridy = 2;
    c.fill = GridBagConstraints.NONE;
    Button okButton = new Button("OK");
    gb.setConstraints(okButton, c);
    okButton.addActionListener(this);
    add(okButton);

    setLocation(400, 200);
    pack();
    setVisible(true);
    toFront();
  }
  DomainPanel(DomainConnection connection) {
    _connection = connection;
    _useColor = System.getProperty("bw") == null;
    if (_useColor) {
      setBackground(Color.red);
    }
    setLayout(new BorderLayout());
    _leftPanel = new LeftPanel();
    _topLabel = new Label("Domain", Label.CENTER);
    _topLabel.setFont(new Font("fixed", Font.ITALIC, 18));
    add(_topLabel, "North");
    add(new BorderPanel(_leftPanel), "West");

    _cellPanel = new CellPanel(_connection);
    _commandPanel = new CommandPanel(_connection);

    _cardPanel = new Panel(_cards);
    _cardPanel.add(new BorderPanel(_cellPanel), "cell");
    _cardPanel.add(new BorderPanel(_commandPanel), "command");
    _cards.show(_cardPanel, "cell");

    add(_cardPanel, "Center");

    _updateButton.addActionListener(this);
    _detailButton.addActionListener(this);
    _commandButton.addActionListener(this);
    _list.addItemListener(this);
  }
Exemple #8
0
 /**
  * Adds a group of checkboxs using a grid layout.
  *
  * @param rows the number of rows
  * @param columns the number of columns
  * @param labels the labels
  * @param defaultValues the initial states
  * @param headings the column headings Example:
  *     http://imagej.nih.gov/ij/plugins/multi-column-dialog/index.html
  */
 public void addCheckboxGroup(
     int rows, int columns, String[] labels, boolean[] defaultValues, String[] headings) {
   Panel panel = new Panel();
   int nRows = headings != null ? rows + 1 : rows;
   panel.setLayout(new GridLayout(nRows, columns, 6, 0));
   int startCBIndex = cbIndex;
   if (checkbox == null) checkbox = new Vector(12);
   if (headings != null) {
     Font font = new Font("SansSerif", Font.BOLD, 12);
     for (int i = 0; i < columns; i++) {
       if (i > headings.length - 1 || headings[i] == null) panel.add(new Label(""));
       else {
         Label label = new Label(headings[i]);
         label.setFont(font);
         panel.add(label);
       }
     }
   }
   int i1 = 0;
   int[] index = new int[labels.length];
   for (int row = 0; row < rows; row++) {
     for (int col = 0; col < columns; col++) {
       int i2 = col * rows + row;
       if (i2 >= labels.length) break;
       index[i1] = i2;
       String label = labels[i1];
       if (label == null || label.length() == 0) {
         Label lbl = new Label("");
         panel.add(lbl);
         i1++;
         continue;
       }
       if (label.indexOf('_') != -1) label = label.replace('_', ' ');
       Checkbox cb = new Checkbox(label);
       checkbox.addElement(cb);
       cb.setState(defaultValues[i1]);
       cb.addItemListener(this);
       if (Recorder.record || macro) saveLabel(cb, labels[i1]);
       if (IJ.isLinux()) {
         Panel panel2 = new Panel();
         panel2.setLayout(new BorderLayout());
         panel2.add("West", cb);
         panel.add(panel2);
       } else panel.add(cb);
       i1++;
     }
   }
   c.gridx = 0;
   c.gridy = y;
   c.gridwidth = 2;
   c.anchor = GridBagConstraints.WEST;
   c.insets = getInsets(10, 0, 0, 0);
   grid.setConstraints(panel, c);
   add(panel);
   y++;
 }
 public NumberPanel(LayoutManager layout, String title, Color bgc) {
   super(layout);
   setBackground(bgc);
   value = new Label("0", Label.CENTER);
   value.setFont(f1);
   this.title = new Label(title, Label.CENTER);
   this.title.setFont(f2);
   add(this.title, "North");
   add(value, "South");
 }
Exemple #10
0
  public void startRecording() {
    statusLabel.setText("Status: Recording...");
    statusLabel.setFont(new Font("Helvetica", Font.BOLD, 12));
    statusLabel.setForeground(Color.red);
    recordButton.setLabel("Stop recording");

    recording = true;

    viewer.setRecordingStatus(fnameField.getText());
  }
Exemple #11
0
  public void stopRecording() {
    statusLabel.setText("Status: Not recording.");
    statusLabel.setFont(new Font("Helvetica", Font.PLAIN, 12));
    statusLabel.setForeground(Color.black);
    recordButton.setLabel("Record");

    recording = false;

    viewer.setRecordingStatus(null);
  }
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.setFont(new Font("Arial", Font.BOLD, 14));

    Label title = new Label("Construction");
    title.setFont(new Font("Arial", Font.BOLD, 14));
    add(title);
    setAlignmentX(CENTER_ALIGNMENT);
    g.drawImage(
        ImagePanel().getScaledInstance(getWidth(), getWidth(), Image.SCALE_SMOOTH), 0, 30, null);
  }
 /* WARNING: THIS METHOD WILL BE REGENERATED. */
 private java.awt.Label getLabel1() {
   if (ivjLabel1 == null) {
     try {
       ivjLabel1 = new java.awt.Label();
       ivjLabel1.setName("Label1");
       ivjLabel1.setFont(new java.awt.Font("serif", 3, 24));
       ivjLabel1.setAlignment(java.awt.Label.CENTER);
       ivjLabel1.setText("Name not found!");
       ivjLabel1.setForeground(java.awt.Color.red);
       // user code begin {1}
       // user code end
     } catch (java.lang.Throwable ivjExc) {
       // user code begin {2}
       // user code end
       handleException(ivjExc);
     }
   }
   return ivjLabel1;
 }
  /** Constructor. */
  private HeaderPanel() {
    setBackground(BACKGROUND_COLOR);
    setLayout(cardLayout);

    add(functionCard, FUNCTION);
    add(messageCard, MESSAGE);

    functionCard.setBackground(BACKGROUND_COLOR);
    functionCard.setLayout(new BorderLayout());

    messageCard.setBackground(BACKGROUND_COLOR);
    messageCard.setLayout(new BorderLayout());

    label.setFont(new Font("Dialog", Font.BOLD, 12));
    label.setAlignment(Label.CENTER);
    label.setForeground(Color.black);

    messageCard.add(label, BorderLayout.CENTER);
  }
    private LeftPanel() {
      super(new BorderLayout());
      _list = new SpyList();
      _updateButton = new Button("Update Cell List");
      _detailButton = new Button("Cell Detail");
      _commandButton = new Button("Commander");
      Label label = new Label("Cell List", Label.CENTER);
      label.setFont(new Font("fixed", Font.ITALIC, 18));
      add(label, "North");
      add(_list, "Center");
      Panel buttonPanel = new Panel(new GridLayout(0, 1));
      buttonPanel.add(_updateButton);
      buttonPanel.add(_detailButton);
      buttonPanel.add(_commandButton);

      add(buttonPanel, "South");
      if (_useColor) {
        setBackground(Color.green);
      }
    }
Exemple #16
0
 public void init() {
   setLayout(new GridLayout(4, 4));
   check = new Button("Check");
   height = new TextField();
   weight = new TextField();
   result = new TextField();
   l1 = new Label("Height in Centimeters ");
   l2 = new Label("Weight in Kilogram");
   l3 = new Label("Index Value");
   not = new Label("Status");
   not.setBackground(Color.black);
   Font notf = new Font("Arial", Font.BOLD, 30);
   not.setFont(notf);
   add(l1);
   add(height);
   add(l2);
   add(weight);
   add(l3);
   add(result);
   add(check);
   add(not);
   check.addActionListener(this);
 }
Exemple #17
0
 /* WARNING: THIS METHOD WILL BE REGENERATED. */
 private java.awt.Label getLabel2() {
   if (ivjLabel2 == null) {
     try {
       ivjLabel2 = new java.awt.Label();
       ivjLabel2.setName("Label2");
       ivjLabel2.setLocation(10, 22);
       ivjLabel2.setText("");
       ivjLabel2.setBackground(java.awt.SystemColor.control);
       ivjLabel2.setSize(70, 12);
       ivjLabel2.setForeground(java.awt.Color.black);
       ivjLabel2.setFont(new java.awt.Font("dialog", 2, 10));
       ivjLabel2.setAlignment(1);
       // user code begin {1}
       // user code end
     } catch (java.lang.Throwable ivjExc) {
       // user code begin {2}
       // user code end
       handleException(ivjExc);
     }
   }
   ;
   return ivjLabel2;
 }
  public RatePlotFileDialogue(
      int X, int Y, int width, int height, Color fg, Color bg, String title, String text) {

    this.setLayout(new BorderLayout());
    this.setSize(width, height);
    this.setLocation(X, Y);

    Label topLabel = new Label(text, Label.CENTER);
    topLabel.setFont(warnFont);
    topLabel.setForeground(fg);
    topLabel.setBackground(bg);

    Panel midPanel = new Panel();
    midPanel.setBackground(bg);
    midPanel.setLayout(null);
    midPanel.add(hT);
    hT.setSize(width, 25);
    this.setTitle(title);

    hT.setForeground(fg);
    hT.setBackground(Color.white);
    hT.setFont(inputFont);
    this.add("North", topLabel);
    this.add("Center", midPanel);

    // Add Cancel and Save buttons

    Panel botPanel = new Panel();
    botPanel.setBackground(bg);
    botPanel.setFont(buttonFont);
    Label label1 = new Label();
    Label label2 = new Label();
    Label label3 = new Label();
    label2.setBackground(bg);
    label3.setBackground(bg);

    Button dismissButton = new Button("Cancel");
    Button saveButton = new Button("Save");
    botPanel.add(dismissButton);
    botPanel.add(label1);
    botPanel.add(saveButton);

    this.add("South", botPanel);
    this.add("West", label2);
    this.add("East", label3);

    // Add inner class event handler for Dismiss button

    dismissButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            hide();
            dispose();
          }
        }); // -- end inner class for Dismiss button processing

    // Add inner class event handler for postscript Save button

    saveButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {

            // Following invokes gp.PSfile() to print the PS
            // file.  Can't invoke this method directly from
            // here because object gp is not recognized.  This
            // works by declaring
            // RateGraphicsPad instance gp to be static and then
            // invoking the static method makePS from RatePlotFrame
            // to in turn invoke gp.PSfile(file).  (Note the use
            // of the "RatePlotFileDialogue.this" construction to
            // invoke the "this" reference for the outer class
            // RatePlotFileDialogue from this anonymous inner class.)
            // In other applications, the second line of the if
            // clause would likely require modification to
            // correspond to the particular classes in use.

            if (RatePlotFileDialogue.this.hT.getText().length() > 0) {
              RatePlotFrame.makePS(RatePlotFileDialogue.this.hT.getText());
              hide();
              dispose();
            } else {

              makeTheWarning(
                  100,
                  100,
                  200,
                  100,
                  Color.black,
                  Color.lightGray,
                  "Warning",
                  "You must supply a file name!",
                  true,
                  RatePlotFileDialogue.this);

              return;
            }
          }
        });

    // Add window close button (inner class)

    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            hide();
            dispose();
          }
        });
  }
  public void makeTheWarning(
      int X,
      int Y,
      int width,
      int height,
      Color fg,
      Color bg,
      String title,
      String text,
      boolean oneLine,
      Frame frame) {

    Font warnFont = new java.awt.Font("SanSerif", Font.BOLD, 12);
    FontMetrics warnFontMetrics = getFontMetrics(warnFont);

    // Create Dialog window with modal blocking set to true.
    // Make final so inner class below can access it.

    final Dialog mww = new Dialog(frame, title, true);
    mww.setLayout(new BorderLayout());
    mww.setSize(width, height);
    mww.setLocation(X, Y);

    // Use Label for 1-line warning

    if (oneLine) {
      Label hT = new Label(text, Label.CENTER);
      hT.setForeground(fg);
      hT.setBackground(bg);
      hT.setFont(warnFont);
      mww.add("Center", hT);

      // Use TextArea for multiline warning

    } else {
      TextArea hT = new TextArea("", height, width, TextArea.SCROLLBARS_NONE);
      hT.setEditable(false);
      hT.setForeground(fg);
      hT.setBackground(bg); // no effect once setEditable (false)?
      hT.setFont(warnFont);
      mww.add("Center", hT);
      hT.appendText(text);
    }

    mww.setTitle(title);

    // Add dismiss button

    Panel botPanel = new Panel();
    botPanel.setBackground(Color.lightGray);
    Label label1 = new Label();
    Label label2 = new Label();

    Button dismissButton = new Button("Dismiss");
    botPanel.add(label1);
    botPanel.add(dismissButton);
    botPanel.add(label2);

    // Add inner class event handler for Dismiss button.  This must be
    // added to the dismissButton before botPanel is added to mww.

    dismissButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            mww.hide();
            mww.dispose();
          }
        });

    mww.add("South", botPanel);

    // Add window closing button (inner class)

    mww.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            mww.hide();
            mww.dispose();
          }
        });

    mww.show(); // Note that this show must come after all the above
    // additions; otherwise they are not added before the
    // window is displayed.
  }
  /** Création de l'intérieur de la fenêtre */
  private void initConteneur() {
    // le fond
    fond = getToolkit().getImage("./images/preference/bomber_fond.gif");
    tracker = new MediaTracker(this);
    tracker.addImage(fond, 0);
    try {
      tracker.waitForID(0);
    } catch (Exception a) {
      System.out.println("Erreur lors chargement de l'image: initConteneur() Preference");
      a.printStackTrace();
    }

    // le layout manager
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 10;
    c.weighty = 10;
    c.ipadx = 10;
    c.ipady = 10;
    c.fill = GridBagConstraints.BOTH;

    // label "Joueurs:"
    Label lbl_joueurs = new Label("Joueurs:");
    lbl_joueurs.setAlignment(Label.CENTER);
    lbl_joueurs.setFont(new Font("SansSerif", Font.BOLD, 16));
    lbl_joueurs.setBackground(Color.black);
    lbl_joueurs.setForeground(Color.red);
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 6;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 10, 10);
    c.anchor = GridBagConstraints.SOUTH;
    layout.setConstraints(lbl_joueurs, c);
    add(lbl_joueurs);

    // choix de couleur du joueur ayant l'identifiant 0
    choix_couleur0 = new Choice();
    choix_couleur0.addItem("rouge");
    choix_couleur0.addItem("bleu");
    choix_couleur0.addItemListener(this);
    choix_couleur0.setBackground(Color.red);
    choix_couleur0.setForeground(Color.black);
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 2;
    c.gridheight = 1;
    c.insets = new Insets(10, 10, 5, 20);
    c.anchor = GridBagConstraints.EAST;
    layout.setConstraints(choix_couleur0, c);
    add(choix_couleur0);

    // nom du joueur ayant l'identifiant 0
    txt_joueur0 = new TextField(noms[0]);
    c.gridx = 2;
    c.gridy = 1;
    c.gridwidth = 4;
    c.gridheight = 1;
    c.insets = new Insets(10, 10, 5, 20);
    c.anchor = GridBagConstraints.WEST;
    layout.setConstraints(txt_joueur0, c);
    add(txt_joueur0);

    // choix de couleur du joueur ayant l'identifiant 1
    choix_couleur1 = new Choice();
    choix_couleur1.addItem("bleu");
    choix_couleur1.addItem("rouge");
    choix_couleur1.addItemListener(this);
    choix_couleur1.setBackground(Color.blue);
    choix_couleur1.setForeground(Color.black);
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 2;
    c.gridheight = 1;
    c.insets = new Insets(10, 10, 20, 20);
    c.anchor = GridBagConstraints.EAST;
    layout.setConstraints(choix_couleur1, c);
    add(choix_couleur1);

    // nom du joueur ayant l'identifiant 1
    txt_joueur1 = new TextField(noms[1]);
    c.gridx = 2;
    c.gridy = 2;
    c.gridwidth = 4;
    c.gridheight = 1;
    c.insets = new Insets(10, 10, 30, 20);
    c.anchor = GridBagConstraints.WEST;
    layout.setConstraints(txt_joueur1, c);
    add(txt_joueur1);

    // label "Nombre De Vies:"
    Label lbl_nbvies = new Label("Nombre De Vies:");
    lbl_nbvies.setAlignment(Label.CENTER);
    lbl_nbvies.setFont(new Font("SansSerif", Font.BOLD, 14));
    lbl_nbvies.setBackground(Color.black);
    lbl_nbvies.setForeground(Color.yellow);
    c.gridx = 0;
    c.gridy = 4;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 5, 10);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(lbl_nbvies, c);
    add(lbl_nbvies);
    // un choix possible
    cbg_vies = new CheckboxGroup();
    Checkbox cb;
    for (int i = 1; i <= 5; i++) {
      if (i == nb_vies) cb = new Checkbox("" + i, cbg_vies, true);
      else cb = new Checkbox("" + i, cbg_vies, false);
      c.gridx = i;
      c.gridy = 4;
      c.gridwidth = 1;
      c.gridheight = 1;
      c.insets = new Insets(20, 10, 5, 10);
      c.anchor = GridBagConstraints.CENTER;
      layout.setConstraints(cb, c);
      add(cb);
    } // for

    // label "Nombre	De Victoires:"
    lbl_victoires = new Label();
    lbl_victoires.setAlignment(Label.CENTER);
    lbl_victoires.setFont(new Font("SansSerif", Font.BOLD, 14));
    lbl_victoires.setText("Nombre De Victoires: " + nb_victoires);
    lbl_victoires.setBackground(Color.black);
    lbl_victoires.setForeground(Color.green);
    c.gridx = 0;
    c.gridy = 6;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 5, 10);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(lbl_victoires, c);
    add(lbl_victoires);

    // choix du nombre de victoires entre un 1 et 9
    sb_victoires = new Scrollbar(Scrollbar.HORIZONTAL, 1, 1, 1, 10);
    sb_victoires.setUnitIncrement(1);
    sb_victoires.setBlockIncrement(2);
    sb_victoires.addAdjustmentListener(this);
    sb_victoires.setValue(nb_victoires);
    c.gridx = 1;
    c.gridy = 6;
    c.gridwidth = 5;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 5, 10);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(sb_victoires, c);
    add(sb_victoires);

    // tirage aléatoire des niveaux
    cb_aleatoire = new Checkbox("Niveaux Aléatoires", aleatoire);
    cb_aleatoire.setFont(new Font("SansSerif", Font.BOLD, 14));
    cb_aleatoire.setBackground(Color.black);
    cb_aleatoire.setForeground(Color.magenta);
    c.gridx = 0;
    c.gridy = 8;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(20, 12, 5, 10);
    c.anchor = GridBagConstraints.EAST;
    layout.setConstraints(cb_aleatoire, c);
    add(cb_aleatoire);

    // label "FPS:" nombre de frames par seconde
    lbl_fps = new Label();
    lbl_fps.setAlignment(Label.CENTER);
    lbl_fps.setFont(new Font("SansSerif", Font.BOLD, 14));
    lbl_fps.setText("FPS: " + fps);
    lbl_fps.setBackground(Color.black);
    lbl_fps.setForeground(Color.orange);
    c.gridx = 0;
    c.gridy = 10;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 5, 10);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(lbl_fps, c);
    add(lbl_fps);

    // choix du nombre de frames par seconde
    sb_fps = new Scrollbar(Scrollbar.HORIZONTAL, 1, 1, 1, 51);
    sb_fps.setUnitIncrement(1);
    sb_fps.setBlockIncrement(10);
    sb_fps.addAdjustmentListener(this);
    sb_fps.setValue(fps);
    c.gridx = 1;
    c.gridy = 10;
    c.gridwidth = 5;
    c.gridheight = 1;
    c.insets = new Insets(20, 10, 5, 10);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(sb_fps, c);
    add(sb_fps);

    // bouton de confirmation
    button_ok = new Button("Ok");
    c.gridx = 0;
    c.gridy = 12;
    c.gridwidth = 6;
    c.gridheight = 1;
    c.insets = new Insets(20, 5, 20, 5);
    c.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(button_ok, c);
    add(button_ok);
    button_ok.addActionListener(this);
  } // initConteneur()
    public BandAdjuster() {

      super("Threshold Colour");
      if (instance != null) {
        instance.toFront();
        return;
      }
      imp = WindowManager.getCurrentImage();
      if (imp == null) {
        IJ.beep();
        IJ.showStatus("No image");
        return;
      }
      IJ.run("Select None");
      thread = new Thread(this, "BandAdjuster");
      WindowManager.addWindow(this);
      instance = this;
      IJ.register(PasteController.class);

      ij = IJ.getInstance();
      Font font = new Font("SansSerif", Font.PLAIN, 10);
      GridBagLayout gridbag = new GridBagLayout();
      GridBagConstraints c = new GridBagConstraints();
      setLayout(gridbag);

      int y = 0;
      c.gridx = 0;
      c.gridy = y;
      c.gridwidth = 1;
      c.weightx = 0;
      c.insets = new Insets(5, 0, 0, 0);
      labelh = new Label("Hue", Label.CENTER);
      add(labelh, c);

      c.gridx = 1;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = 0;
      c.insets = new Insets(7, 0, 0, 0);
      labelf = new Label("Filter type", Label.RIGHT);
      add(labelf, c);

      // plot
      c.gridx = 0;
      c.gridy = y;
      c.gridwidth = 1;
      c.fill = c.BOTH;
      c.anchor = c.CENTER;
      c.insets = new Insets(0, 5, 0, 0);
      add(plot, c);

      // checkboxes
      panelh = new Panel();
      filterTypeH = new CheckboxGroup();
      bandPassH = new Checkbox("Pass");
      bandPassH.setCheckboxGroup(filterTypeH);
      bandPassH.addItemListener(this);
      panelh.add(bandPassH);
      bandStopH = new Checkbox("Stop");
      bandStopH.setCheckboxGroup(filterTypeH);
      bandStopH.addItemListener(this);
      panelh.add(bandStopH);
      bandPassH.setState(true);
      c.gridx = 1;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(5, 0, 0, 0);
      add(panelh, c);

      // minHue slider
      minSlider = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 90 : 100;
      c.fill = c.HORIZONTAL;
      c.insets = new Insets(5, 5, 0, 0);

      add(minSlider, c);
      minSlider.addAdjustmentListener(this);
      minSlider.setUnitIncrement(1);

      // minHue slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 10 : 0;
      c.insets = new Insets(5, 0, 0, 0);
      label1 = new Label("       ", Label.LEFT);
      label1.setFont(font);
      add(label1, c);

      // maxHue sliderHue
      maxSlider = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y;
      c.gridwidth = 1;
      c.weightx = 100;
      c.insets = new Insets(5, 5, 0, 0);
      add(maxSlider, c);
      maxSlider.addAdjustmentListener(this);
      maxSlider.setUnitIncrement(1);

      // maxHue slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.gridy = y++;
      c.weightx = 0;
      c.insets = new Insets(5, 0, 0, 0);
      label2 = new Label("       ", Label.LEFT);
      label2.setFont(font);
      add(label2, c);

      // =====
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = 0;
      c.insets = new Insets(10, 0, 0, 0);
      labels = new Label("Saturation", Label.CENTER);
      add(labels, c);

      // plot
      c.gridx = 0;
      c.gridy = y;
      c.gridwidth = 1;
      c.fill = c.BOTH;
      c.anchor = c.CENTER;
      c.insets = new Insets(0, 5, 0, 0);
      add(splot, c);

      // checkboxes
      panels = new Panel();
      filterTypeS = new CheckboxGroup();
      bandPassS = new Checkbox("Pass");
      bandPassS.setCheckboxGroup(filterTypeS);
      bandPassS.addItemListener(this);
      panels.add(bandPassS);
      bandStopS = new Checkbox("Stop");
      bandStopS.setCheckboxGroup(filterTypeS);
      bandStopS.addItemListener(this);
      panels.add(bandStopS);
      bandPassS.setState(true);
      c.gridx = 1;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(5, 0, 0, 0);
      add(panels, c);

      // minSat slider
      minSlider2 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 90 : 100;
      c.fill = c.HORIZONTAL;
      c.insets = new Insets(5, 5, 0, 0);
      add(minSlider2, c);
      minSlider2.addAdjustmentListener(this);
      minSlider2.setUnitIncrement(1);

      // minSat slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 10 : 0;
      c.insets = new Insets(5, 0, 0, 0);
      label3 = new Label("       ", Label.LEFT);
      label3.setFont(font);
      add(label3, c);

      // maxSat slider
      maxSlider2 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = 100;
      c.insets = new Insets(5, 5, 0, 0);
      add(maxSlider2, c);
      maxSlider2.addAdjustmentListener(this);
      maxSlider2.setUnitIncrement(1);

      // maxSat slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.weightx = 0;
      c.insets = new Insets(5, 0, 0, 0);
      label4 = new Label("       ", Label.LEFT);
      label4.setFont(font);
      add(label4, c);

      // =====
      c.gridx = 0;
      c.gridwidth = 1;
      c.gridy = y++;
      c.weightx = 0;
      c.insets = new Insets(10, 0, 0, 0);
      labelb = new Label("Brightness", Label.CENTER);
      add(labelb, c);

      c.gridx = 0;
      c.gridwidth = 1;
      c.gridy = y;
      c.fill = c.BOTH;
      c.anchor = c.CENTER;
      c.insets = new Insets(0, 5, 0, 0);
      add(bplot, c);

      // checkboxes
      panelb = new Panel();
      filterTypeB = new CheckboxGroup();
      bandPassB = new Checkbox("Pass");
      bandPassB.setCheckboxGroup(filterTypeB);
      bandPassB.addItemListener(this);
      panelb.add(bandPassB);
      bandStopB = new Checkbox("Stop");
      bandStopB.setCheckboxGroup(filterTypeB);
      bandStopB.addItemListener(this);
      panelb.add(bandStopB);
      bandPassB.setState(true);
      c.gridx = 1;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(5, 0, 0, 0);
      add(panelb, c);

      // minBri slider
      minSlider3 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 90 : 100;
      c.fill = c.HORIZONTAL;
      c.insets = new Insets(5, 5, 0, 0);
      add(minSlider3, c);
      minSlider3.addAdjustmentListener(this);
      minSlider3.setUnitIncrement(1);

      // minBri slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.weightx = IJ.isMacintosh() ? 10 : 0;
      c.insets = new Insets(5, 0, 0, 0);
      label5 = new Label("       ", Label.LEFT);
      label5.setFont(font);
      add(label5, c);

      // maxBri slider
      maxSlider3 = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, sliderRange);
      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 1;
      c.weightx = 100;
      c.insets = new Insets(5, 5, 0, 0);
      add(maxSlider3, c);
      maxSlider3.addAdjustmentListener(this);
      maxSlider3.setUnitIncrement(1);

      // maxBri slider label
      c.gridx = 1;
      c.gridwidth = 1;
      c.weightx = 0;
      c.insets = new Insets(5, 0, 0, 0);
      label6 = new Label("       ", Label.LEFT);
      label6.setFont(font);
      add(label6, c);

      // =====
      panelt = new Panel();
      threshold = new Checkbox("Threshold");
      threshold.addItemListener(this);
      panelt.add(threshold);

      invert = new Checkbox("Invert");
      invert.addItemListener(this);
      panelt.add(invert);

      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(0, 0, 0, 0);
      add(panelt, c);

      // buttons
      panel = new Panel();
      // panel.setLayout(new GridLayout(2, 2, 0, 0));
      originalB = new Button("Original");
      originalB.setEnabled(false);
      originalB.addActionListener(this);
      originalB.addKeyListener(ij);
      panel.add(originalB);

      filteredB = new Button("Filtered");
      filteredB.setEnabled(false);
      filteredB.addActionListener(this);
      filteredB.addKeyListener(ij);
      panel.add(filteredB);

      stackB = new Button("Stack");
      stackB.addActionListener(this);
      stackB.addKeyListener(ij);
      panel.add(stackB);

      helpB = new Button("Help");
      helpB.addActionListener(this);
      helpB.addKeyListener(ij);
      panel.add(helpB);

      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(0, 0, 0, 0);
      add(panel, c);

      panelMode = new Panel();

      sampleB = new Button("Sample");
      sampleB.addActionListener(this);
      sampleB.addKeyListener(ij);
      panelMode.add(sampleB);

      colourMode = new CheckboxGroup();
      hsb = new Checkbox("HSB");
      hsb.setCheckboxGroup(colourMode);
      hsb.addItemListener(this);
      panelMode.add(hsb);
      hsb.setState(true);
      rgb = new Checkbox("RGB");
      rgb.setCheckboxGroup(colourMode);
      rgb.addItemListener(this);
      panelMode.add(rgb);

      c.gridx = 0;
      c.gridy = y++;
      c.gridwidth = 2;
      c.insets = new Insets(0, 0, 0, 0);
      add(panelMode, c);

      addKeyListener(ij); // ImageJ handles keyboard shortcuts
      pack();
      GUI.center(this);
      setVisible(true);

      ip = setup(imp);
      if (ip == null) {
        imp.unlock();
        IJ.beep();
        IJ.showStatus("RGB image cannot be thresholded");
        return;
      }
      thread.start();
    }
Exemple #22
0
  private void setup() {
    setLayout(null);
    this.setSize(1200, 800);
    setBackground(Color.DARK_GRAY);
    list.setFont(new Font("Arial", Font.PLAIN, 24));
    list.setBounds(52, 118, 429, 501);

    selecionado1 = new Label("");
    selecionado1.setForeground(Color.WHITE);
    selecionado1.setFont(new Font("Dialog", Font.PLAIN, 18));
    selecionado1.setBounds(560, 128, 611, 43);
    add(selecionado1);

    PreencheGenero();
    add(list);

    logout = new JButton("Logout");
    logout.setBounds(1074, 673, 97, 25);
    logout.addActionListener(this);
    logout.setVisible(true);
    add(logout);

    autor = new JRadioButton("Autor");
    autor.setForeground(Color.WHITE);
    autor.setFont(new Font("Tahoma", Font.PLAIN, 18));
    autor.setSelected(false);
    autor.setBackground(Color.DARK_GRAY);
    autor.setBounds(52, 56, 127, 25);
    autor.addActionListener(this);
    add(autor);

    titulo = new JRadioButton("Trabalho artístico");
    titulo.setForeground(Color.WHITE);
    titulo.setFont(new Font("Tahoma", Font.PLAIN, 18));
    titulo.setBackground(Color.DARK_GRAY);
    titulo.setSelected(false);
    titulo.setBounds(275, 56, 181, 25);
    titulo.addActionListener(this);
    add(titulo);

    genero = new JRadioButton("Gênero");
    genero.setForeground(Color.WHITE);
    genero.setFont(new Font("Tahoma", Font.PLAIN, 18));
    genero.setBackground(Color.DARK_GRAY);
    genero.setSelected(true);
    genero.setBounds(499, 58, 127, 25);
    genero.addActionListener(this);
    add(genero);

    selecionado2 = new Label("");
    selecionado2.setForeground(Color.WHITE);
    selecionado2.setFont(new Font("Dialog", Font.PLAIN, 18));
    selecionado2.setBounds(560, 197, 611, 43);
    add(selecionado2);

    selecionado3 = new Label("");
    selecionado3.setForeground(Color.WHITE);
    selecionado3.setFont(new Font("Dialog", Font.PLAIN, 18));
    selecionado3.setBounds(560, 268, 611, 55);
    add(selecionado3);

    label = new Label("Selecione um Filtro");
    label.setForeground(Color.WHITE);
    label.setFont(new Font("Dialog", Font.PLAIN, 18));
    label.setBounds(52, 10, 611, 43);
    add(label);

    adicionar = new JButton("Adicionar");
    adicionar.setBounds(956, 673, 97, 25);
    adicionar.addActionListener(this);
    add(adicionar);

    Label logado = new Label("Selecione um Filtro");
    logado.setAlignment(Label.RIGHT);
    logado.setForeground(Color.WHITE);
    logado.setFont(new Font("Dialog", Font.PLAIN, 18));
    logado.setBounds(722, 10, 449, 43);
    logado.setText("Olá, " + Main.user.getNome());
    add(logado);
  }
Exemple #23
0
  /** This is the main method for configuring the <it>MyScreenAbout</it>. */
  public MyScreenAbout() { // constructor
    setSize(470, 600);
    setTitle("informació sobre el MAGNUS");
    setResizable(false);
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    URL url = getClass().getResource("icon.png");
    Image image = toolkit.getImage(url);
    setIconImage(image);
    ScrollPane scrollPane = new ScrollPane(ScrollPane.SCROLLBARS_NEVER);
    scrollPane.setSize(470, 148);
    scrollPane.setBackground(new Color(0, 128, 0));
    Canvas canvas = new MyCanvasAbout();
    canvas.setSize(470, 148);
    scrollPane.add(canvas);
    add(scrollPane, BorderLayout.NORTH);

    ScrollPane infoscroll = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
    infoscroll.setSize(470, 400);
    infoscroll.setBackground(new Color(255, 255, 255));
    Panel info = new Panel();
    info.setLayout(new GridLayout(56, 1));
    infoscroll.add(info);

    Label ts1 = new Label("MAGNUS 0.1.1");
    ts1.setFont(new Font("SansSerif", Font.BOLD, 10));
    ts1.setForeground(new Color(0, 0, 0));
    ts1.setBackground(new Color(255, 255, 255));
    info.add(ts1);

    Label ts2 = new Label("http://magnusproject.wordpress.com");
    ts2.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts2.setForeground(new Color(0, 0, 255));
    ts2.setBackground(new Color(255, 255, 255));
    info.add(ts2);

    Label ts3 = new Label(" ");
    ts3.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts3.setForeground(new Color(0, 0, 255));
    ts3.setBackground(new Color(255, 255, 255));
    info.add(ts3);

    Label ts4 = new Label("Alexandre Trilla Castelló");
    ts4.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts4.setForeground(new Color(0, 0, 0));
    ts4.setBackground(new Color(255, 255, 255));
    info.add(ts4);

    Label ts5 = new Label("          http://www.salle.url.edu/~atrilla/");
    ts5.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts5.setForeground(new Color(0, 0, 255));
    ts5.setBackground(new Color(255, 255, 255));
    info.add(ts5);

    Label ts7 = new Label("Departament d'Educació de la Generalitat de Catalunya");
    ts7.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts7.setForeground(new Color(0, 0, 0));
    ts7.setBackground(new Color(255, 255, 255));
    info.add(ts7);

    Label ts8 = new Label("          http://www.xtec.cat");
    ts8.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts8.setForeground(new Color(0, 0, 255));
    ts8.setBackground(new Color(255, 255, 255));
    info.add(ts8);

    Label ts9 = new Label("Universitat Ramon Llull La Salle Enginyeria de Telecomunicació");
    ts9.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts9.setForeground(new Color(0, 0, 0));
    ts9.setBackground(new Color(255, 255, 255));
    info.add(ts9);

    Label ts10 = new Label("          http://www.salle.url.edu");
    ts10.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts10.setForeground(new Color(0, 0, 255));
    ts10.setBackground(new Color(255, 255, 255));
    info.add(ts10);

    Label ts11 = new Label(" ");
    ts11.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts11.setForeground(new Color(0, 0, 0));
    ts11.setBackground(new Color(255, 255, 255));
    info.add(ts11);

    Label ts111 = new Label(" ");
    ts111.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts111.setForeground(new Color(0, 0, 255));
    ts111.setBackground(new Color(255, 255, 255));
    info.add(ts111);

    DesenvCanvas dc = new DesenvCanvas();
    info.add(dc);

    Label ts17 = new Label("MAGNUS ha estat desenvolupat per Alexandre Trilla");
    ts17.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts17.setForeground(new Color(0, 0, 0));
    ts17.setBackground(new Color(255, 255, 255));
    info.add(ts17);

    Label ts18 = new Label("pel Servei de Tecnologies per l'Aprenentatge i el");
    ts18.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts18.setForeground(new Color(0, 0, 0));
    ts18.setBackground(new Color(255, 255, 255));
    info.add(ts18);

    Label ts19 = new Label("Coneixement del Departament d'Educació de la");
    ts19.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts19.setForeground(new Color(0, 0, 0));
    ts19.setBackground(new Color(255, 255, 255));
    info.add(ts19);

    Label ts20 = new Label("Generalitat de Catalunya.");
    ts20.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts20.setForeground(new Color(0, 0, 0));
    ts20.setBackground(new Color(255, 255, 255));
    info.add(ts20);

    Label ts21 = new Label(" ");
    ts21.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts21.setForeground(new Color(0, 0, 0));
    ts21.setBackground(new Color(255, 255, 255));
    info.add(ts21);

    Label ts22 = new Label("Alhora, MAGNUS ha constituït el Projecte Final de");
    ts22.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts22.setForeground(new Color(0, 0, 0));
    ts22.setBackground(new Color(255, 255, 255));
    info.add(ts22);

    Label ts23 = new Label("Carrera de l'autor, havent cursat d'Enginyeria");
    ts23.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts23.setForeground(new Color(0, 0, 0));
    ts23.setBackground(new Color(255, 255, 255));
    info.add(ts23);

    Label ts24 = new Label("Superior de Telecomunicacions a la Universitat");
    ts24.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts24.setForeground(new Color(0, 0, 0));
    ts24.setBackground(new Color(255, 255, 255));
    info.add(ts24);

    Label ts25 = new Label("Ramon Llull La Salle de Barcelona.");
    ts25.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts25.setForeground(new Color(0, 0, 0));
    ts25.setBackground(new Color(255, 255, 255));
    info.add(ts25);

    Label ts26 = new Label(" ");
    ts26.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts26.setForeground(new Color(0, 0, 0));
    ts26.setBackground(new Color(255, 255, 255));
    info.add(ts26);

    Label ts261 = new Label(" ");
    ts261.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts261.setForeground(new Color(0, 0, 0));
    ts261.setBackground(new Color(255, 255, 255));
    info.add(ts261);

    CredenCanvas cc = new CredenCanvas();
    info.add(cc);

    Label ts12 = new Label("Aquest producte inclou programari desenvolupat per:");
    ts12.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts12.setForeground(new Color(0, 0, 0));
    ts12.setBackground(new Color(255, 255, 255));
    info.add(ts12);

    Label ts121 = new Label(" ");
    ts121.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts121.setForeground(new Color(0, 0, 0));
    ts121.setBackground(new Color(255, 255, 255));
    info.add(ts121);

    Label ts13 = new Label("Sphinx-4");
    ts13.setFont(new Font("SansSerif", Font.BOLD, 10));
    ts13.setForeground(new Color(0, 0, 0));
    ts13.setBackground(new Color(255, 255, 255));
    info.add(ts13);

    Label ts14 = new Label("Carnegie Mellon University");
    ts14.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts14.setForeground(new Color(0, 0, 0));
    ts14.setBackground(new Color(255, 255, 255));
    info.add(ts14);

    Label ts142 = new Label("          http://cmusphinx.sourceforge.net/sphinx4/");
    ts142.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts142.setForeground(new Color(0, 0, 255));
    ts142.setBackground(new Color(255, 255, 255));
    info.add(ts142);

    Label ts141 = new Label(" ");
    ts141.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts141.setForeground(new Color(0, 0, 0));
    ts141.setBackground(new Color(255, 255, 255));
    info.add(ts141);

    Label ts15 = new Label("Jdom");
    ts15.setFont(new Font("SansSerif", Font.BOLD, 10));
    ts15.setForeground(new Color(0, 0, 0));
    ts15.setBackground(new Color(255, 255, 255));
    info.add(ts15);

    Label ts16 = new Label("The JDOM Project");
    ts16.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts16.setForeground(new Color(0, 0, 0));
    ts16.setBackground(new Color(255, 255, 255));
    info.add(ts16);

    Label ts162 = new Label("          http://www.jdom.org");
    ts162.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts162.setForeground(new Color(0, 0, 255));
    ts162.setBackground(new Color(255, 255, 255));
    info.add(ts162);

    Label ts161 = new Label(" ");
    ts161.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts161.setForeground(new Color(0, 0, 0));
    ts161.setBackground(new Color(255, 255, 255));
    info.add(ts161);

    Label ts163 = new Label(" ");
    ts163.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts163.setForeground(new Color(0, 0, 0));
    ts163.setBackground(new Color(255, 255, 255));
    info.add(ts163);

    LicCanvas lc = new LicCanvas();
    info.add(lc);

    Label ts64 = new Label("Copyright (C) 2007 Alexandre Trilla &");
    ts64.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts64.setForeground(new Color(0, 0, 0));
    ts64.setBackground(new Color(255, 255, 255));
    info.add(ts64);

    Label ts65 = new Label("Departament d'Educació de la Generalitat de Catalunya &");
    ts65.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts65.setForeground(new Color(0, 0, 0));
    ts65.setBackground(new Color(255, 255, 255));
    info.add(ts65);

    Label ts66 = new Label("Universitat Ramon Llull La Salle Enginyeria de Telecomunicació");
    ts66.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts66.setForeground(new Color(0, 0, 0));
    ts66.setBackground(new Color(255, 255, 255));
    info.add(ts66);

    Label ts67 = new Label(" ");
    ts67.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts67.setForeground(new Color(0, 0, 0));
    ts67.setBackground(new Color(255, 255, 255));
    info.add(ts67);

    Label ts68 = new Label("Aquest programa és lliure. Podeu distribuir-lo i/o modificar-");
    ts68.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts68.setForeground(new Color(0, 0, 0));
    ts68.setBackground(new Color(255, 255, 255));
    info.add(ts68);

    Label ts69 = new Label("lo conforme a les disposicions de la Llicència Pública General");
    ts69.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts69.setForeground(new Color(0, 0, 0));
    ts69.setBackground(new Color(255, 255, 255));
    info.add(ts69);

    Label ts70 = new Label("de GNU (GPL), publicada per la Free Software Foundation, ja");
    ts70.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts70.setForeground(new Color(0, 0, 0));
    ts70.setBackground(new Color(255, 255, 255));
    info.add(ts70);

    Label ts71 = new Label("sigui la versió 3 de la llicència o qualsevol versió posterior.");
    ts71.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts71.setForeground(new Color(0, 0, 0));
    ts71.setBackground(new Color(255, 255, 255));
    info.add(ts71);

    Label ts711 = new Label(" ");
    ts711.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts711.setForeground(new Color(0, 0, 0));
    ts711.setBackground(new Color(255, 255, 255));
    info.add(ts711);

    Label ts72 = new Label("Aquest programa es distribueix amb la intenció de resultar");
    ts72.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts72.setForeground(new Color(0, 0, 0));
    ts72.setBackground(new Color(255, 255, 255));
    info.add(ts72);

    Label ts73 = new Label("útil, però SENSE CAP GARANTIA, fins i tot sense la garantia");
    ts73.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts73.setForeground(new Color(0, 0, 0));
    ts73.setBackground(new Color(255, 255, 255));
    info.add(ts73);

    Label ts74 = new Label("implícita de COMERCIABILITAT o CONVENIÈNCIA PER A UN");
    ts74.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts74.setForeground(new Color(0, 0, 0));
    ts74.setBackground(new Color(255, 255, 255));
    info.add(ts74);

    Label ts75 = new Label("PROPÒSIT PARTICULAR. Per a més detalls, vegeu la Llicència");
    ts75.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts75.setForeground(new Color(0, 0, 0));
    ts75.setBackground(new Color(255, 255, 255));
    info.add(ts75);

    Label ts76 = new Label("Pública General de GNU.");
    ts76.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts76.setForeground(new Color(0, 0, 0));
    ts76.setBackground(new Color(255, 255, 255));
    info.add(ts76);

    Label ts77 = new Label(" ");
    ts77.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts77.setForeground(new Color(0, 0, 0));
    ts77.setBackground(new Color(255, 255, 255));
    info.add(ts77);

    Label ts771 = new Label(" ");
    ts771.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts771.setForeground(new Color(0, 0, 0));
    ts771.setBackground(new Color(255, 255, 255));
    info.add(ts771);

    SupCanvas supc = new SupCanvas();
    info.add(supc);

    Label ts1234 = new Label("Desenvolupat en col·laboració amb Enginyeria i");
    ts1234.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts1234.setForeground(new Color(0, 0, 0));
    ts1234.setBackground(new Color(255, 255, 255));
    info.add(ts1234);

    Label ts12345 = new Label("Arquitectura La Salle (Universitat Ramon Llull)");
    ts12345.setFont(new Font("SansSerif", Font.PLAIN, 10));
    ts12345.setForeground(new Color(0, 0, 0));
    ts12345.setBackground(new Color(255, 255, 255));
    info.add(ts12345);

    SalleCanvas sallec = new SalleCanvas();
    // info.add(sallec);
    add(sallec, BorderLayout.SOUTH);

    add(infoscroll, BorderLayout.CENTER);

    addWindowListener(
        new WindowAdapter() {

          /**
           * This method catches the closing event and react accordingly.
           *
           * @param e WindowEvent: the window closing event.
           */
          public void windowClosing(WindowEvent e) {
            setVisible(false);
          }
        });
  }
Exemple #24
0
 /**
  * Static Init
  *
  * @throws Exception
  */
 private void jbInit() throws Exception {
   this.setBackground(Color.white);
   this.setName("splash");
   this.setUndecorated(true);
   //
   productLabel.setAlignment(Label.CENTER);
   message.setFont(new java.awt.Font("Serif", 3, 20)); //  italic bold 20 pt
   message.setForeground(SystemColor.activeCaption);
   message.setAlignment(Label.CENTER);
   contentPanel.setLayout(contentLayout);
   contentPanel.setName("splashContent");
   contentPanel.setBackground(Color.white);
   //
   productLabel.setFont(new java.awt.Font("Serif", 2, 10));
   productLabel.setForeground(Color.blue);
   productLabel.setText(Adempiere.getSubtitle());
   //	productLabel.setToolTipText(Adempiere.getURL());
   //
   contentPanel.add(
       cImage,
       new GridBagConstraints(
           1,
           0,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(10, 5, 0, 10),
           0,
           0));
   contentPanel.add(
       productLabel,
       new GridBagConstraints(
           1,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(0, 5, 0, 10),
           0,
           0));
   contentPanel.add(
       message,
       new GridBagConstraints(
           1,
           2,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(5, 5, 10, 10),
           0,
           0));
   //
   this.add(aImage, BorderLayout.WEST);
   this.add(contentPanel, BorderLayout.EAST);
 } //	jbInit
  @SuppressWarnings({"unchecked", "unchecked"})
  private void labelInit() {
    laltitle = new Label("耶紗夕慕", 2);
    laltitle.setBounds(80, 40, 150, 40);
    laltitle.setFont(new Font(null, 15, 23));
    this.add(laltitle);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    laId = new Label("ID:");
    laId.setBounds(50, 90, 50, 30);
    laId.setFont(new Font(null, 15, 20));
    this.add(laId);

    laName = new Label("慕兆�");
    laName.setBounds(200, 90, 50, 30);
    laName.setFont(new Font(null, 15, 20));
    this.add(laName);

    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    laWriter = new Label("恬宀��");
    laWriter.setBounds(50, 120, 50, 30);
    laWriter.setFont(new Font(null, 15, 20));
    this.add(laWriter);

    laPrice = new Label("汽勺�");
    laPrice.setBounds(200, 120, 50, 30);
    laPrice.setFont(new Font(null, 15, 20));
    this.add(laPrice);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    laNum = new Label("方楚�");
    laNum.setBounds(50, 150, 50, 30);
    laNum.setFont(new Font(null, 15, 20));
    this.add(laNum);

    laAllPrice = new Label("悳勺�");
    laAllPrice.setBounds(200, 150, 50, 30);
    laAllPrice.setFont(new Font(null, 15, 20));
    this.add(laAllPrice);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    laDiscopy = new Label("孵諏�");
    laDiscopy.setBounds(50, 180, 50, 30);
    laDiscopy.setFont(new Font(null, 15, 20));
    this.add(laDiscopy);

    laBack = new Label("辛曜算�");
    laBack.setBounds(200, 180, 70, 30);
    laBack.setFont(new Font(null, 15, 20));
    this.add(laBack);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    laBusiness = new Label("竃井芙�");
    laBusiness.setBounds(50, 210, 70, 30);
    laBusiness.setFont(new Font(null, 15, 20));
    this.add(laBusiness);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ArrayList arryListBook = new ArrayList();
    arryListBook = BookFactory.getInstance().getOneBook();
    int strBookInfoID;
    strBookInfoID = arryListBook.size();
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    strBookInfoID += 1;
    latxtId = new Label(strBookInfoID + "", 2);
    latxtId.setBounds(110, 80, 70, 40);
    latxtId.setFont(new Font(null, 15, 18));
    this.add(latxtId);
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    lachoAllPrice = new Label(NumAllPrice + "");
    lachoAllPrice.setBounds(260, 150, 100, 25);
    lachoAllPrice.setFont(new Font(null, 15, 18));
    this.add(lachoAllPrice);
  }
Exemple #26
0
  /**
   * If 'applet' is not null, creates a new ImageJ frame that runs as an applet. If 'mode' is
   * ImageJ.EMBEDDED and 'applet is null, creates an embedded (non-standalone) version of ImageJ.
   */
  public ImageJ(java.applet.Applet applet, int mode) {
    super("ImageJ");
    embedded = applet == null && (mode == EMBEDDED || mode == NO_SHOW);
    this.applet = applet;
    String err1 = Prefs.load(this, applet);
    if (IJ.isLinux()) {
      backgroundColor = new Color(240, 240, 240);
      setBackground(backgroundColor);
    }
    Menus m = new Menus(this, applet);
    String err2 = m.addMenuBar();
    m.installPopupMenu(this);
    setLayout(new GridLayout(2, 1));

    // Tool bar
    toolbar = new Toolbar();
    toolbar.addKeyListener(this);
    add(toolbar);

    // Status bar
    statusBar = new Panel();
    statusBar.setLayout(new BorderLayout());
    statusBar.setForeground(Color.black);
    statusBar.setBackground(backgroundColor);
    statusLine = new Label();
    statusLine.setFont(SansSerif12);
    statusLine.addKeyListener(this);
    statusLine.addMouseListener(this);
    statusBar.add("Center", statusLine);
    progressBar = new ProgressBar(120, 20);
    progressBar.addKeyListener(this);
    progressBar.addMouseListener(this);
    statusBar.add("East", progressBar);
    statusBar.setSize(toolbar.getPreferredSize());
    add(statusBar);

    IJ.init(this, applet);
    addKeyListener(this);
    addWindowListener(this);
    setFocusTraversalKeysEnabled(false);

    Point loc = getPreferredLocation();
    Dimension tbSize = toolbar.getPreferredSize();
    int ijWidth = tbSize.width + 10;
    int ijHeight = 100;
    setCursor(Cursor.getDefaultCursor()); // work-around for JDK 1.1.8 bug
    if (mode != NO_SHOW) {
      if (IJ.isWindows())
        try {
          setIcon();
        } catch (Exception e) {
        }
      setBounds(loc.x, loc.y, ijWidth, ijHeight); // needed for pack to work
      setLocation(loc.x, loc.y);
      pack();
      setResizable(!(IJ.isMacintosh() || IJ.isWindows())); // make resizable on Linux
      show();
    }
    if (err1 != null) IJ.error(err1);
    if (err2 != null) {
      IJ.error(err2);
      IJ.runPlugIn("ij.plugin.ClassChecker", "");
    }
    m.installStartupMacroSet();
    if (IJ.isMacintosh() && applet == null) {
      Object qh = null;
      qh = IJ.runPlugIn("MacAdapter", "");
      if (qh == null) IJ.runPlugIn("QuitHandler", "");
    }
    if (applet == null) IJ.runPlugIn("ij.plugin.DragAndDrop", "");
    String str = m.getMacroCount() == 1 ? " macro" : " macros";
    IJ.showStatus(version() + m.getPluginCount() + " commands; " + m.getMacroCount() + str);
    // if (applet==null && !embedded && Prefs.runSocketListener)
    //	new SocketListener();
    configureProxy();
    if (applet == null) loadCursors();
  }
  private void makePanel() {
    Label colonLabel = new Label(":", Label.RIGHT);
    colonLabel.setFont(new Font("monospace", Font.BOLD, 12));

    Panel hostPanel = new Panel(new BorderLayout());
    hostPanel.add(new Label("Host", Label.CENTER), BorderLayout.NORTH);
    hostPanel.add(hostField, BorderLayout.CENTER);
    hostPanel.add(new Label(), BorderLayout.SOUTH);
    hostPanel.add(new Label(), BorderLayout.WEST);
    hostPanel.add(colonLabel, BorderLayout.EAST);

    Panel portPanel = new Panel(new BorderLayout());
    portPanel.add(new Label("Port", Label.CENTER), BorderLayout.NORTH);
    portPanel.add(portField, BorderLayout.CENTER);
    portPanel.add(new Label(), BorderLayout.SOUTH);
    portPanel.add(new Label(), BorderLayout.WEST);
    portPanel.add(new Label(), BorderLayout.EAST);

    Panel northPanel = new Panel(new BorderLayout());
    northPanel.add(hostPanel, BorderLayout.WEST);
    northPanel.add(portPanel, BorderLayout.EAST);

    Button okButton = new Button("Ok");
    okButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            closeDialog(true);
          }
        });
    okButton.addKeyListener(
        new KeyListener() {
          public void keyPressed(KeyEvent ke) {
            if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
              closeDialog(true);
            }
          }

          public void keyReleased(KeyEvent ke) {}

          public void keyTyped(KeyEvent ke) {}
        });

    Button cancelButton = new Button("Cancel");
    cancelButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            closeDialog(false);
          }
        });
    cancelButton.addKeyListener(
        new KeyListener() {
          public void keyPressed(KeyEvent ke) {
            if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
              closeDialog(false);
            }
          }

          public void keyReleased(KeyEvent ke) {}

          public void keyTyped(KeyEvent ke) {}
        });

    Panel buttonPanel = new Panel(new GridLayout(1, 3));
    buttonPanel.add(okButton);
    buttonPanel.add(new Label());
    buttonPanel.add(cancelButton);

    Panel southPanel = new Panel(new BorderLayout());
    southPanel.add(new Label(), BorderLayout.WEST);
    southPanel.add(buttonPanel, BorderLayout.CENTER);
    southPanel.add(new Label(), BorderLayout.EAST);

    setLayout(new BorderLayout());
    add(northPanel, BorderLayout.NORTH);
    add(southPanel, BorderLayout.SOUTH);
  }
Exemple #28
0
  mupdate() {
    f = new JFrame("POS");
    p = new Panel();
    l1 = new Label("Welcome:Admin");
    l2 = new Label("POINT   OF   SALE");
    l14 = new Label("Enter Manager_Id");

    l3 = new Label("Name");
    l4 = new Label("Father's_Name");
    l5 = new Label("Manager_Id");
    l6 = new Label("Password");
    l7 = new Label("Gender");
    l9 = new Label("Address");
    l8 = new Label("D.O.B.");
    l10 = new Label("Contact_No.");
    l11 = new Label("E-Mail_Id");
    l12 = new Label("Location");
    l13 =
        new Label(
            "_______________________________________________________________________________________________");

    l15 =
        new Label(
            "_______________________________________________________________________________________________________________________");
    cbg = new CheckboxGroup();
    c1 = new Checkbox("Male", cbg, false);
    c2 = new Checkbox("Female", cbg, false);

    t11 = new TextField();
    t2 = new TextField();
    t3 = new TextField();
    t4 = new TextField();
    t5 = new TextField();
    t6 = new TextField();
    t7 = new TextField();
    t8 = new TextField();
    t9 = new TextField();
    t10 = new TextField();

    try {
      t1 = new Choice();
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection con = DriverManager.getConnection("jdbc:odbc:raman1");
      Statement stm = con.createStatement();
      ResultSet rs = stm.executeQuery("select * from mprofile");
      while (rs.next()) {
        String a2 = rs.getString(3);
        t1.add(a2);
      }
    } catch (Exception e) {
      System.out.println(e);
    }

    b1 = new Button("Search");
    b2 = new Button("Update");
    b3 = new Button("Calendar");
    b4 = new Button("Close");
    b5 = new Button("Back");
    b6 = new Button("Logout");

    f1 = new Font("sherif", Font.BOLD | Font.ITALIC, 45);
    f2 = new Font("sherif", Font.BOLD | Font.ITALIC, 30);
    f3 = new Font("sherif", Font.BOLD | Font.ITALIC, 35);
    f4 = new Font("sherif", Font.BOLD, 20);
    f5 = new Font("sherif", Font.BOLD | Font.ITALIC, 15);
    f6 = new Font("sherif", Font.BOLD | Font.ITALIC, 20);
    l1.setFont(f5);
    l2.setFont(f1);
    l3.setFont(f6);
    l4.setFont(f6);
    l5.setFont(f6);
    l6.setFont(f6);
    l7.setFont(f6);
    l8.setFont(f6);
    l9.setFont(f6);
    l10.setFont(f6);
    l11.setFont(f6);
    l12.setFont(f6);
    l13.setFont(f6);
    l14.setFont(f6);

    b1.setFont(f6);
    b2.setFont(f6);
    b3.setFont(f6);
    b4.setFont(f6);
    b5.setFont(f6);
    b6.setFont(f6);
  }