示例#1
0
  /** Start view */
  private void startView() {
    InternationalizationCentral iCentral = new InternationalizationCentral();

    logManager.trace("Initializing components");
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    int xPosition = (int) (dimension.getWidth() - 400);
    frame = new JFormFrame(new Point(xPosition, 0), 400);
    frame.setInternalSize(300, 200);
    animeTitleLabel = new JLabel(iCentral.getWord("title"));
    currentEpisodeLabel = new JLabel(iCentral.getWord("current_episode"));
    animeTitleField = new JTextField();
    currentEpisodeField = new JTextField();

    frame.setOkButtonLabel(iCentral.getWord("ok"));
    frame.setCancelButtonLabel(iCentral.getWord("cancel"));

    logManager.trace("Setting bounds");
    animeTitleLabel.setBounds(10, 20, 150, 25);
    currentEpisodeLabel.setBounds(10, 60, 150, 25);
    animeTitleField.setBounds(160, 20, 150, 25);
    currentEpisodeField.setBounds(160, 60, 50, 25);

    logManager.trace("Joining components");
    frame.addToInternalPanel(animeTitleLabel);
    frame.addToInternalPanel(currentEpisodeLabel);
    frame.addToInternalPanel(animeTitleField);
    frame.addToInternalPanel(currentEpisodeField);
    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  } // end of the method startView
示例#2
0
 /** Close view */
 public void close() {
   logManager.debug("Closing view");
   frame.dispose();
 } // end of the method close
示例#3
0
 /**
  * Check if frame is open
  *
  * @return <code>boolean</code> if problem open?
  */
 public boolean isOpen() {
   return frame.isVisible();
 } // end of the method isOpen
示例#4
0
 /**
  * Add WindowAdapter for the frame
  *
  * @param windowAdapter
  */
 public void addWindowListener(WindowAdapter windowAdapter) {
   logManager.trace("Window Listener added to the frame");
   frame.addWindowListener(windowAdapter);
 } // end of the method addWindowListener
示例#5
0
 /**
  * Add actionListener for the button cancel
  *
  * @param ac
  */
 public void addCancelActionListener(ActionListener ac) {
   logManager.trace("Action Listener added to the button OK");
   frame.addCancelButtonActionListener(ac);
 } // end of the method addCancelActionListener