Пример #1
0
  private void ustawLayout() {
    layout = new FlowLayout();
    this.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();

    c.fill = GridBagConstraints.BOTH;
    c.ipady = 120;
    c.weightx = 1;
    c.weighty = 1.3;
    c.gridx = 1;
    c.gridy = 0;
    this.add(panelRozmowy, c);

    c.fill = GridBagConstraints.BOTH;
    c.ipady = 100; // make this component tall
    c.weightx = 1;
    c.weighty = 1.9;
    c.gridx = 1;
    c.gridy = 1;
    this.add(panelWiadomosci, c);

    c.fill = GridBagConstraints.EAST;
    c.anchor = GridBagConstraints.WEST;
    c.ipady = 10;
    c.ipadx = 10;
    c.weightx = 1;
    c.weighty = 0.1;
    c.gridx = 1;
    c.gridy = 2;
    add(wyslij, c);
  }
  private JPanel createReportingPanel() {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.gridx = 0;
    c.ipady = 2;
    c.fill = GridBagConstraints.BOTH;
    panel.add(myShowInfo, c);
    panel.add(myShowWarnings, c);
    c.insets.left = 16;
    panel.add(myKeepModelsWithWarnings, c);
    panel.add(myShowBadChildWarnings, c);
    myButtonState.track(
        myShowInfo, myShowWarnings, myKeepModelsWithWarnings, myShowBadChildWarnings);

    final ChangeListener listener =
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            myKeepModelsWithWarnings.setEnabled(myShowWarnings.isSelected());
            myShowBadChildWarnings.setEnabled(myShowWarnings.isSelected());
          }
        };
    myShowWarnings.addChangeListener(listener);

    c.insets.left = 0;
    c.ipady = 0;
    panel.add(createLinkErrorsGroup(), c);
    panel.setBorder(IdeBorderFactory.createTitledBorder("Error reporting"));
    return panel;
  }
  /**
   * This method initializes jContentPane
   *
   * @return javax.swing.JPanel
   */
  private javax.swing.JPanel getJContentPane() {
    if (jContentPane == null) {
      java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints14 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints13 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints12 = new GridBagConstraints();

      javax.swing.JLabel jLabel = new JLabel();

      jContentPane = new javax.swing.JPanel();
      jContentPane.setLayout(new GridBagLayout());
      jLabel.setName("jLabel");
      jLabel.setText("");
      gridBagConstraints12.gridx = 0;
      gridBagConstraints12.gridy = 1;
      gridBagConstraints12.ipadx = 0;
      gridBagConstraints12.ipady = 0;
      gridBagConstraints12.anchor = java.awt.GridBagConstraints.WEST;
      gridBagConstraints12.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints12.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints12.weightx = 1.0D;
      gridBagConstraints13.gridx = 1;
      gridBagConstraints13.gridy = 1;
      gridBagConstraints13.ipadx = 0;
      gridBagConstraints13.ipady = 0;
      gridBagConstraints13.fill = java.awt.GridBagConstraints.NONE;
      gridBagConstraints13.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints13.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints14.gridx = 2;
      gridBagConstraints14.gridy = 1;
      gridBagConstraints14.ipadx = 0;
      gridBagConstraints14.ipady = 0;
      gridBagConstraints14.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints14.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints1.weightx = 1.0;
      gridBagConstraints1.weighty = 1.0;
      gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints1.gridwidth = 3;
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      jContentPane.add(getJSplitPane(), gridBagConstraints1);
      jContentPane.add(jLabel, gridBagConstraints12);
      jContentPane.add(getBtnOK(), gridBagConstraints13);
      jContentPane.add(getBtnCancel(), gridBagConstraints14);
    }
    return jContentPane;
  }
Пример #4
0
  private void packDevices() {
    int i, j;
    GridBagLayout gbl = new GridBagLayout();
    getContentPane().setLayout(gbl);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(2, 2, 2, 2);

    for (i = 0, j = 0; i < cnt; i++) {
      if (devArray[i].isSpecial) continue;

      gbc.weightx = 0.8;
      gbc.fill = GridBagConstraints.HORIZONTAL;
      gbc.gridx = 0;
      gbc.gridy = j;
      gbc.ipadx = 5;
      gbc.ipady = 5;
      gbl.setConstraints(devArray[i].widgetset.l1, gbc);
      getContentPane().add(devArray[i].widgetset.l1);

      gbc.weightx = 1.0;
      gbc.gridx = 1;
      gbc.gridy = j;
      gbc.ipadx = 0;
      gbc.ipady = 0;
      gbl.setConstraints(devArray[i].widgetset.wc, gbc);
      getContentPane().add(devArray[i].widgetset.wc);

      gbc.weightx = 0.8;
      gbc.gridx = 2;
      gbc.gridy = j;
      gbc.ipadx = 5;
      gbc.ipady = 5;
      gbl.setConstraints(devArray[i].widgetset.l2, gbc);
      getContentPane().add(devArray[i].widgetset.l2);

      gbc.gridx = 3;
      gbc.gridy = j;
      gbl.setConstraints(devArray[i].widgetset.ln, gbc);
      getContentPane().add(devArray[i].widgetset.ln);

      gbc.gridx = 4;
      gbc.gridy = j;
      gbl.setConstraints(devArray[i].widgetset.lval, gbc);
      getContentPane().add(devArray[i].widgetset.lval);

      j++;
    }

    pack();
  }
Пример #5
0
  // Initializing this component.
  private void jbInit() {
    callStackTable.addFocusListener(
        new FocusListener() {
          public void focusGained(FocusEvent e) {
            callStackTable_focusGained(e);
          }

          public void focusLost(FocusEvent e) {
            callStackTable_focusLost(e);
          }
        });
    callStackTable.setTableHeader(null);
    callStackTable.setDefaultRenderer(callStackTable.getColumnClass(0), getCellRenderer());
    scrollPane = new JScrollPane(callStackTable);
    setVisibleRows(DEFAULT_VISIBLE_ROWS);
    scrollPane.setLocation(0, 27);
    setBorder(BorderFactory.createEtchedBorder());
    // this.setLayout(null);
    this.setLayout(new GridBagLayout());
    nameLbl.setText("Call Stack");
    nameLbl.setBounds(new Rectangle(3, 4, 70, 23));
    nameLbl.setFont(Utilities.labelsFont);

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 7;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.PAGE_END;
    c.gridx = 0;
    c.gridy = 2;
    this.add(scrollPane, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0.0;
    c.gridwidth = 3;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.gridx = 0;
    c.gridy = 0;
    c.insets = new Insets(5, 0, 0, 0);
    this.add(nameLbl, c);
  }
  private JPanel createOptionsPanel() {
    JPanel optionsPanel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.gridx = 0;
    c.ipady = 2;
    c.fill = GridBagConstraints.BOTH;
    optionsPanel.add(mySaveTransientModelsCheckBox, c);
    optionsPanel.add(myCheckModelsBeforeGenerationCheckBox, c);
    optionsPanel.add(myStrictMode, c);
    c.ipady = 0;
    optionsPanel.add(createParallelGenerationGroup(), c);
    c.ipady = 2;
    optionsPanel.add(myIncremental, c);
    c.insets.left = 16;
    optionsPanel.add(myIncrementalCache, c);
    if (InternalFlag.isInternalMode()) {
      optionsPanel.add(myDebugIncrementalDependencies, c);
    }
    c.insets.left = 0;
    optionsPanel.add(myInplaceTransform, c);

    myButtonState.track(
        mySaveTransientModelsCheckBox,
        myCheckModelsBeforeGenerationCheckBox,
        myStrictMode,
        myInplaceTransform);
    myButtonState.track(myDebugIncrementalDependencies, myIncremental, myIncrementalCache);

    final ChangeListener listener =
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            myIncremental.setEnabled(myStrictMode.isSelected());
            myIncrementalCache.setEnabled(myStrictMode.isSelected() && myIncremental.isSelected());
            if (InternalFlag.isInternalMode()) {
              myDebugIncrementalDependencies.setEnabled(
                  myStrictMode.isSelected() && myIncremental.isSelected());
            }
          }
        };
    myStrictMode.addChangeListener(listener);
    myIncremental.addChangeListener(listener);
    optionsPanel.setBorder(IdeBorderFactory.createTitledBorder("General"));

    mySaveTransientModelsCheckBox.addItemListener(myStatusUpdater);
    myInplaceTransform.addItemListener(myStatusUpdater);
    return optionsPanel;
  }
  private void jbInit() throws Exception {
    this.removeAll();

    // creamos y centramos la cuadrícula con los valores pasados
    //    	crearCentrarCuadricula(context, (Double)
    // blackboard.get(GraticuleCreatorPlugIn.CELL_SIDE_LENGTH_X),
    //    			(Double) blackboard.get(GraticuleCreatorPlugIn.CELL_SIDE_LENGTH_Y),
    //    			(Integer) blackboard.get(GraticuleCreatorPlugIn.LAYER_HEIGHT_IN_CELLS),
    //    			(Integer) blackboard.get(GraticuleCreatorPlugIn.LAYER_WIDTH_IN_CELLS),
    //    			(Coordinate) blackboard.get(GraticuleCreatorPlugIn.SOUTHWEST_CORNER_OF_LEFT_LAYER));

    this.setLayout(new GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
    gridBagConstraints1.gridx = 0;
    gridBagConstraints1.gridy = 1;
    gridBagConstraints1.weightx = 1.0;
    gridBagConstraints1.weighty = 1.0;
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.ipadx = -21;
    gridBagConstraints1.ipady = 141;
    java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
    gridBagConstraints2.gridx = 0;
    gridBagConstraints2.gridy = 0;
    gridBagConstraints2.insets = new java.awt.Insets(5, 5, 5, 5);
    this.add(getGraticuleCells(), gridBagConstraints1);
    this.add(getPanelButtonAllUser(), gridBagConstraints2);
  }
Пример #8
0
 /**
  * This method initializes jContentPane
  *
  * @return javax.swing.JPanel
  */
 private JPanel getJContentPane() {
   if (jContentPane == null) {
     GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
     gridBagConstraints9.gridheight = 1;
     gridBagConstraints9.gridy = 0;
     gridBagConstraints9.ipadx = 0;
     gridBagConstraints9.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints9.weightx = 1.0D;
     gridBagConstraints9.fill = GridBagConstraints.HORIZONTAL;
     gridBagConstraints9.gridx = 0;
     GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
     gridBagConstraints8.gridx = 0;
     gridBagConstraints8.ipadx = 0;
     gridBagConstraints8.ipady = 0;
     gridBagConstraints8.fill = GridBagConstraints.BOTH;
     gridBagConstraints8.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints8.weightx = 1.0D;
     gridBagConstraints8.weighty = 1.0D;
     gridBagConstraints8.gridy = 1;
     jContentPane = new JPanel();
     jContentPane.setLayout(new GridBagLayout());
     jContentPane.add(getMainPanel(), gridBagConstraints8);
     jContentPane.add(getTitlePanel(), gridBagConstraints9);
   }
   return jContentPane;
 }
Пример #9
0
 /**
  * This method initializes jContentPane
  *
  * @return javax.swing.JPanel
  */
 private JPanel getJContentPane() {
   if (jContentPane == null) {
     GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
     gridBagConstraints2.gridx = 0;
     gridBagConstraints2.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints2.gridy = 1;
     GridBagConstraints gridBagConstraints = new GridBagConstraints();
     gridBagConstraints.fill = GridBagConstraints.BOTH;
     gridBagConstraints.gridy = 0;
     gridBagConstraints.weightx = 1.0;
     gridBagConstraints.weighty = 1.0;
     gridBagConstraints.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints.gridx = 0;
     GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
     gridBagConstraints1.gridx = 0;
     gridBagConstraints1.ipadx = 0;
     gridBagConstraints1.ipady = 0;
     gridBagConstraints1.gridy = 1;
     jContentPane = new JPanel();
     jContentPane.setLayout(new GridBagLayout());
     jContentPane.add(getJTabbedPane(), gridBagConstraints);
     jContentPane.add(getBtnCancel(), gridBagConstraints2);
   }
   return jContentPane;
 }
Пример #10
0
 public static void addComponent(
     Container container,
     Component component,
     int gridx,
     int gridy,
     int gridwidth,
     int gridheight,
     int fill,
     int anchor,
     Insets insets,
     int ipadx,
     int ipady,
     double weightx,
     double weighty) {
   java.awt.LayoutManager lm = container.getLayout();
   GridBagConstraints gbc = new GridBagConstraints();
   gbc.gridx = gridx;
   gbc.gridy = gridy;
   gbc.gridwidth = gridwidth;
   gbc.gridheight = gridheight;
   gbc.fill = fill;
   gbc.anchor = anchor;
   gbc.insets = insets;
   gbc.ipadx = ipadx;
   gbc.ipady = ipady;
   gbc.weightx = weightx;
   gbc.weighty = weighty;
   ((GridBagLayout) lm).setConstraints(component, gbc);
   container.add(component);
 }
Пример #11
0
  public Plot2Da() {
    check_ = new JCheckBox("Hold on");
    plot_ = new Plot2D();

    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 2, 2, 2);
    c.weightx = 1.0;
    c.weighty = 1.0;

    c.gridheight = 1;
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 0;
    add(check_, c);

    c.gridwidth = 1;
    c.gridheight = 1;
    c.gridx = 0;
    c.gridy = 1;
    c.fill = GridBagConstraints.REMAINDER;
    c.ipadx = plot_.getSize().width + 100;
    c.ipady = plot_.getSize().height + 100;
    plot_.setBackground(Color.WHITE);

    add(plot_, c);

    setBorder(BorderFactory.createEtchedBorder());
  }
Пример #12
0
  private JPanel initUserPanel() {
    JPanel userGridPanel = new JPanel();
    userGridPanel.setLayout(new GridBagLayout());
    userGridPanel.setBorder(BorderFactory.createEtchedBorder());

    // line 0: Title
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipady = 1; // make this component tall
    c.weightx = 0.0;
    c.gridwidth = 1;
    c.gridy = 0;
    c.gridx = 0;
    userGridPanel.add(new JLabel("Highlighted strings:"), c);

    // Line >0: Content
    int n = 1;
    LinkedList<HighlightSearchEntry> newEntrys = highlighter.getHighlights();
    panelList = new LinkedList<>();

    for (HighlightSearchEntry entry : newEntrys) {
      HighlightEntryLineUi panelLine = new HighlightEntryLineUi(userGridPanel, n++, entry);
      panelList.add(panelLine);
    }

    extraHighlight = new HighlightSearchEntry();
    panelLineExtra = new HighlightEntryLineUi(userGridPanel, n + 1, extraHighlight);

    return userGridPanel;
  }
  /**
   * This method initializes jPanel
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      java.awt.GridBagConstraints gridBagConstraints7 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints5 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

      jPanel = new JPanel();
      jPanel.setLayout(new GridBagLayout());
      jPanel.setName("jPanel");
      gridBagConstraints2.weightx = 1.0;
      gridBagConstraints2.weighty = 1.0;
      gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints5.gridx = 0;
      gridBagConstraints5.gridy = 1;
      gridBagConstraints5.ipadx = 0;
      gridBagConstraints5.ipady = 0;
      gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints5.weightx = 1.0D;
      gridBagConstraints5.weighty = 1.0D;
      gridBagConstraints5.insets = new java.awt.Insets(2, 5, 2, 5);
      gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints7.weightx = 1.0;
      gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints7.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints7.gridx = 0;
      gridBagConstraints7.gridy = 0;
      gridBagConstraints7.insets = new java.awt.Insets(2, 5, 2, 5);
      jPanel.add(getTxtHeadline(), gridBagConstraints7);
      jPanel.add(getPanelParam(), gridBagConstraints5);
    }
    return jPanel;
  }
Пример #14
0
  private void makeGridPanel(Component[] components) {
    final Insets insets = new Insets(5, 5, 5, 5);
    final GridBagConstraints gbc = new GridBagConstraints();

    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.insets = insets;
    gbc.ipadx = 0;
    gbc.ipady = 0;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.fill = GridBagConstraints.HORIZONTAL;

    int i = 0;
    int j = 0;

    for (Component component : components) {
      gbc.gridx = i;
      gbc.gridy = j;
      gbc.gridwidth = 1;
      gbc.gridheight = 1;

      centerPanel.add(component, gbc);

      i++;

      // 2 components per row
      if ((i % 2) == 0) {
        j++;
        i = 0;
      }
    }
  }
Пример #15
0
  /** init lays out the window and sets up components */
  public void init() {
    /*
     * BorderLayout just makes sure the Object in the Center gets most of
     * the screen
     */
    setLayout(new BorderLayout());
    // Information area where we can put some text occasionally
    info1 = new Label("Welcome !");
    // put it along the top
    add("North", info1);

    // Plotting area - create our own sky class
    theSky = new HealCanvas();
    // put it in the center of the window - most space
    add("Center", theSky);
    theSky.setupScene();
    theSky.showScene();

    // Create a panel to put the controls in - panel is a long strip
    FlowLayout fl = new FlowLayout(FlowLayout.CENTER, 1, 1);
    Panel p = new Panel(fl);

    // Create buttons and add this as Actionlistener - add them to panel
    Button quit = new Button("Quit");
    quit.addActionListener(this);
    p.add("West", quit);
    // put the panel at the bottom of the screen
    add("South", p);

    Panel rp = new Panel();
    rp.setBackground(Color.black);

    // rp.setLayout(new GridLayout(3,1));
    GridBagLayout gridbag = new GridBagLayout();
    rp.setLayout(gridbag);
    GridBagConstraints cons = new GridBagConstraints();
    cons.fill = GridBagConstraints.BOTH;
    cons.gridy = GridBagConstraints.RELATIVE;
    cons.gridx = 0;
    cons.ipadx = 0;
    cons.ipady = 10;

    HealPanel hpan = new HealPanel();
    hpan.setCanvas(theSky);
    gridbag.setConstraints(hpan, cons);
    rp.add(hpan);
    // Create control panel for rotations
    rotPanel = new RotatePanel();
    gridbag.setConstraints(rotPanel, cons);
    rp.add(rotPanel);
    // attach the rotPanel panel to the sky
    rotPanel.setScene(theSky);
    // add to right of screen
    this.add("East", rp);
    rotPanel.start();
  };
Пример #16
0
  protected void buttonLayer(GridBagConstraints gridConsts) {
    gridConsts.fill = GridBagConstraints.HORIZONTAL;
    gridConsts.ipady = 0;
    gridConsts.weightx = 0.5;
    gridConsts.gridwidth = 1;
    gridConsts.gridx = 0;
    gridConsts.gridy = 3;
    gridConsts.insets = new Insets(15, 0, 0, 40); // top padding
    this.add(prevButton, gridConsts);

    gridConsts.fill = GridBagConstraints.HORIZONTAL;
    gridConsts.ipady = 12;
    gridConsts.weightx = 0.5;
    gridConsts.gridwidth = 1;
    gridConsts.gridx = 1;
    gridConsts.gridy = 3;
    gridConsts.insets = new Insets(15, 40, 0, 0); // top padding
    this.add(nextButton, gridConsts);
  }
Пример #17
0
 protected void imagePanelLayer(GridBagConstraints gridConsts) {
   gridConsts.fill = GridBagConstraints.BOTH;
   gridConsts.ipady = 650; // make this component tall
   gridConsts.gridwidth = 2;
   gridConsts.weightx = 1;
   gridConsts.gridx = 0;
   gridConsts.gridy = 1;
   gridConsts.insets = new Insets(0, 5, 0, 0);
   this.add(imgPanel, gridConsts);
 }
Пример #18
0
 protected void listPanelLayer(GridBagConstraints gridConsts) {
   gridConsts.fill = GridBagConstraints.HORIZONTAL;
   gridConsts.ipady = 120;
   gridConsts.gridwidth = 2;
   gridConsts.weightx = 1;
   gridConsts.gridx = 0;
   gridConsts.gridy = 2;
   gridConsts.insets = new Insets(0, 0, 0, 0);
   this.add(anmlPanel, gridConsts);
 }
  // Color gre;
  Rules(String se) {
    email = se;
    conti = new Button("Continue");
    rules = new Button("ClicK Here For Rules");
    p1 = new JOptionPane();
    Icon image = new ImageIcon("books.jpg");
    Icon image1 = new ImageIcon("girl.jpg");
    Icon image2 = new ImageIcon("uit.jpg");
    gl = new GridBagLayout();
    gbc = new GridBagConstraints();
    conti.addActionListener(this);
    rules.addActionListener(this);
    // gre=new Color(117,102,185);
    p = new Panel();
    p2 = new Panel();
    p3 = new Panel();
    p4 = new Panel();
    f = new Frame();
    pic = new JLabel(image);
    pic1 = new JLabel(image1);
    pic2 = new JLabel(image2);
    gbc.anchor = GridBagConstraints.SOUTHWEST;
    gl.setConstraints(pic1, gbc);
    gbc.anchor = GridBagConstraints.SOUTHEAST;
    gl.setConstraints(pic, gbc);
    Insets is = new Insets(30, 30, 30, 30);
    gbc.insets = is;
    gbc.ipadx = 14;
    gbc.ipady = 8;
    gl.setConstraints(rules, gbc);
    gl.setConstraints(conti, gbc);
    p2.setLayout(gl);
    p4.add(pic2);
    p2.add(pic);
    p3.setLayout(gl);
    p3.add(pic1);
    p.add(conti);
    p.add(rules);
    p.setLayout(gl);
    f.add(p4, "North");
    f.add(p3, "East");
    f.add(p2, "West");

    f.add(p, "Center");
    f.setTitle("RULES BOOK");
    // f.setBackground(gre);
    f.setVisible(true);
    f.setSize(900, 600);
    f.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent we) {
            System.exit(0);
          }
        });
  }
Пример #20
0
 protected void labelLayer(GridBagConstraints gridConsts) {
   gridConsts.fill = GridBagConstraints.BOTH;
   gridConsts.ipady = 15; // make this component tall
   gridConsts.gridwidth = 2;
   gridConsts.weightx = 1;
   gridConsts.gridx = 0;
   gridConsts.gridy = 0;
   gridConsts.insets = new Insets(0, 75, 0, 0);
   dateStrLabel.setHorizontalAlignment(JLabel.CENTER);
   this.add(dateStrLabel, gridConsts);
 }
Пример #21
0
  public static void initGUI() {
    JPanel optionsPane = initOptionsPane();
    JPanel chatPane = initChatPane();

    initStatusBar();
    initButtons();
    GridBagConstraints c = new GridBagConstraints();

    c.fill = GridBagConstraints.HORIZONTAL;

    c.gridx = 0;
    c.gridy = 0;
    mainPane.add(chatPane, c);

    c.gridx = 1;
    c.gridy = 0;
    mainPane.add(optionsPane, c);

    c.gridx = 0;
    c.gridy = 1;
    c.ipady = 30;
    mainPane.add(buttonPane, c);

    c.gridy = 2;
    c.ipady = 0;
    mainPane.add(statusBar, c);

    mainFrame.setContentPane(mainPane);
    mainFrame.pack();
    mainFrame.setVisible(true);

    mainFrame.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            changeStatusNTS(EConnectionStatus.DISCONNECTING, true);
            System.exit(0);
          }
        });

    changeStatusNTS(EConnectionStatus.NULL, true);
  }
Пример #22
0
  /**
   * This method initializes jPanel
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      jPanel = new JPanel();
      jPanel.setLayout(new GridBagLayout());
      GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      lblMessage = new JLabel();

      lblMessage.setText(" ");
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      gridBagConstraints1.ipadx = 273;
      gridBagConstraints1.ipady = 79;
      gridBagConstraints2.gridx = 0;
      gridBagConstraints2.gridy = 0;
      gridBagConstraints2.ipadx = 0;
      gridBagConstraints2.ipady = 0;
      gridBagConstraints2.insets = new java.awt.Insets(20, 20, 20, 20);
      jPanel.add(lblMessage, gridBagConstraints2);
    }
    return jPanel;
  }
Пример #23
0
  private void jbInit() throws Exception {
    this.removeAll();
    this.setLayout(new GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
    gridBagConstraints1.gridx = 0;
    gridBagConstraints1.gridy = 1;
    gridBagConstraints1.weightx = 1.0;
    gridBagConstraints1.weighty = 1.0;
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.ipadx = -21;
    gridBagConstraints1.ipady = 141;
    gridBagConstraints1.insets = new java.awt.Insets(5, 5, 5, 5);
    java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
    gridBagConstraints2.gridx = 0;
    gridBagConstraints2.gridy = 2;
    gridBagConstraints2.insets = new java.awt.Insets(5, 5, 5, 5);
    java.awt.GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
    gridBagConstraints3.gridx = 0;
    gridBagConstraints3.gridy = 3;
    gridBagConstraints3.weightx = 1.0;
    gridBagConstraints3.weighty = 1.0;
    gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints3.ipadx = -21;
    gridBagConstraints3.ipady = 141;
    gridBagConstraints3.insets = new java.awt.Insets(5, 5, 5, 5);

    java.awt.GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
    gridBagConstraints4.gridx = 0;
    gridBagConstraints4.gridy = 0;

    String projectName = (String) blackboard.get(MOBILE_PROJECT_NAME);
    JLabel extractionProjectNameLabel = new JLabel(projectName);

    this.add(extractionProjectNameLabel, gridBagConstraints4);

    this.add(getWriteableLayerScrollPane(), gridBagConstraints1);
    this.add(getReadableLayerScrollPane(), gridBagConstraints3);
    this.add(getGraticuleButton(), gridBagConstraints2);
  }
 private void initGridBagConstraints(final GridBagConstraints c) {
   c.anchor = GridBagConstraints.CENTER;
   c.fill = GridBagConstraints.NONE;
   c.gridwidth = 1;
   c.gridheight = 1;
   c.gridx = GridBagConstraints.RELATIVE;
   c.gridy = GridBagConstraints.RELATIVE;
   c.insets = zeroInsets;
   c.ipadx = 4; // not the usual default
   c.ipady = 4; // not the usual default
   c.weightx = 0.0;
   c.weighty = 0.0;
 };
Пример #25
0
  private void updateFromFeature(Feature feature) {
    GridBagConstraints c = new GridBagConstraints();
    JPanel gridPanel = new JPanel(new GridBagLayout());
    gridPanel.setBackground(Color.white);

    //
    // literature & dbxref
    literatureTextArea = new QualifierTextArea();
    literatureTextArea.setBorder(BorderFactory.createLineBorder(Color.gray));
    dbxrefTextArea = new QualifierTextArea();
    dbxrefTextArea.setBorder(BorderFactory.createLineBorder(Color.gray));

    literatureTextArea
        .getDocument()
        .addDocumentListener(new TextAreaDocumentListener(literatureTextArea));

    dbxrefTextArea.getDocument().addDocumentListener(new TextAreaDocumentListener(dbxrefTextArea));

    final QualifierVector qualifiers = feature.getQualifiers().copy();
    final StringBuffer litBuffer = new StringBuffer();
    final StringBuffer dbxrefBuffer = new StringBuffer();

    for (int i = 0; i < qualifiers.size(); ++i) {
      Qualifier this_qualifier = (Qualifier) qualifiers.elementAt(i);
      if (this_qualifier.getName().equals("literature"))
        appendToBuffer(this_qualifier.getValues(), litBuffer);
      else if (this_qualifier.getName().equalsIgnoreCase("Dbxref"))
        appendToBuffer(this_qualifier.getValues(), dbxrefBuffer);
    }

    c.gridx = 0;
    c.gridy = 0;
    c.ipadx = 5;
    c.ipady = 5;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.NONE;
    gridPanel.add(new JLabel("Literature"), c);
    c.gridx = 1;
    gridPanel.add(literatureTextArea, c);

    c.gridx = 0;
    c.gridy = 1;
    gridPanel.add(new JLabel("Dbxref"), c);
    c.gridx = 1;
    gridPanel.add(dbxrefTextArea, c);

    add(gridPanel);

    literatureTextArea.setText(litBuffer.toString() + "\n");
    dbxrefTextArea.setText(dbxrefBuffer.toString() + "\n");
  }
Пример #26
0
  public SearchPanel(UIRoot root) {
    this.root = root;
    searchField = new KTextField(20);
    final KButton searchBtn = new KButton("Search");
    final KLabel label = new KLabel("Search:");

    searchField.setBorder(new KLineBorder(1, true));
    label.setFont(res.getFont(KFontFamilyName.MONOSPACE, 30));
    resultPanel.setLayout(new GridLayout(DEFAULT_SEARCH_SIZE * 2, 1));

    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weighty = 0;
    gbc.weightx = 0;
    gbc.insets = new Insets(10, 10, 10, 10);
    add(label, gbc);
    gbc.gridx = 1;
    gbc.ipadx = 300;
    add(searchField, gbc);
    gbc.gridx = 2;
    add(searchBtn, gbc);
    // setup search panel.
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridy = 1;
    gbc.gridx = 0;
    gbc.gridwidth = 0;
    gbc.weighty = 1.0;
    gbc.weightx = 3;
    gbc.ipady = 300;
    gbc.insets = new Insets(25, 25, 25, 25);
    add(resultPanel, gbc);

    searchField.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            String searchTerm = searchField.getText();
            searchField.setText("");
            currentPage = 0;
            currentSearch = searchTerm;
            search(searchTerm);
            searchField.repaint();
            resultPanel.repaint();
          }
        });
    root.searchPanel = this;
  }
Пример #27
0
  /*
   * helper class to initialize empty spaces
   * @param int x - column of button
   * @param int y - row of button
   * @param Dimension btnSize - sets the size of the button
   */
  public void createBlankButtons(int x, int y, Dimension btnSize) {
    String output = "";
    Font clueFont = new Font("Arial", Font.PLAIN, 8);

    // initialize next myButton
    btn[activeMyButtons] = new myButton();
    String toolTip = ("" + activeMyButtons);
    btn[activeMyButtons].setDefaultToolTipText(toolTip);
    btn[activeMyButtons].setToolTipText(toolTip);

    // get next available myButton and assign current position
    btn[activeMyButtons].positionX = x;
    btn[activeMyButtons].positionY = y;
    btn[activeMyButtons].button = activeMyButtons;
    btn[activeMyButtons].setPreferredSize(btnSize);
    btn[activeMyButtons].setFont(clueFont);

    // assign GridBagConstraints for //position
    cons.gridx = x;
    cons.gridy = y;
    cons.gridwidth = 1;
    cons.gridheight = 1;
    cons.ipadx = 0;
    cons.ipady = 0;

    // determine position and set alternating color
    if (((x % 2 == 0) && (y % 2 == 0)) || ((x % 2 != 0) && (y % 2 != 0))) {
      btn[activeMyButtons].setBackground(new Color(152, 86, 112));
      btn[activeMyButtons].setDefaultColor(new Color(152, 86, 112));
    } else {

      btn[activeMyButtons].setBackground(new Color(128, 48, 82));
      btn[activeMyButtons].setDefaultColor(new Color(128, 48, 82));
    }

    btn[activeMyButtons].setOpaque(true);
    btn[activeMyButtons].setBorderPainted(false);

    // add button to boardPanel
    this.add(btn[activeMyButtons], cons);
    btn[activeMyButtons].addActionListener(new myActionListener());
    validate();

    // pass output to setOutput()
    output = "activeMyButtons: " + activeMyButtons + " " + btn[activeMyButtons].getDefaultColor();
    // setOutput(output);

    activeMyButtons++;
  }
Пример #28
0
  /**
   * Constructor of the map. Create the MapGui and the BottomPannel.
   *
   * @param map The Map used to create the MapGUI.
   */
  public MainFrame(Map map) {
    this.setTitle("Tapawaru");

    GridBagLayout myGrid = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    this.setLayout(myGrid);

    MapGUI mapGui = new MapGUI(map);
    mapGui.setPreferredSize(new Dimension(mapGui.guiMapSize()[0], mapGui.guiMapSize()[1]));
    c.fill = GridBagConstraints.BOTH;
    c.ipady = 0;
    c.weightx = 0;
    c.gridwidth = 2;
    c.gridx = 0;
    c.gridy = 0;
    this.add(mapGui, c);

    BottomPanel botPanel = new BottomPanel(map);
    botPanel.setPreferredSize(new Dimension(mapGui.guiMapSize()[0], 200));
    c.fill = GridBagConstraints.BOTH;
    c.ipady = 0;
    c.weightx = 0;
    c.gridwidth = 2;
    c.gridx = 0;
    c.gridy = 1;
    this.add(botPanel, c);

    mapGui.addBotPanel(botPanel);

    this.addKeyListener(botPanel);
    this.pack();
    this.setVisible(true);
    this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    this.setResizable(false);
    map.setMapGui(mapGui);
  }
Пример #29
0
  /**
   * This method initializes jPanel
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
      java.awt.GridBagConstraints gridBagConstraints13 = new GridBagConstraints();

      javax.swing.JLabel jLabel2 = new JLabel();

      java.awt.GridBagConstraints gridBagConstraints3 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

      jPanel = new JPanel();
      jPanel.setLayout(new GridBagLayout());
      jPanel.setPreferredSize(new java.awt.Dimension(400, 90));
      jPanel.setMinimumSize(new java.awt.Dimension(400, 90));
      gridBagConstraints2.gridx = 1;
      gridBagConstraints2.gridy = 5;
      gridBagConstraints2.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints3.gridx = 2;
      gridBagConstraints3.gridy = 5;
      gridBagConstraints3.insets = new java.awt.Insets(2, 2, 2, 10);
      gridBagConstraints3.anchor = java.awt.GridBagConstraints.EAST;

      gridBagConstraints13.gridx = 0;
      gridBagConstraints13.gridy = 5;
      gridBagConstraints13.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints13.weightx = 1.0D;
      gridBagConstraints13.insets = new java.awt.Insets(2, 10, 2, 5);

      gridBagConstraints15.weightx = 1.0;
      gridBagConstraints15.weighty = 0.0D;
      gridBagConstraints15.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints15.insets = new java.awt.Insets(2, 10, 5, 10);
      gridBagConstraints15.gridwidth = 3;
      gridBagConstraints15.gridx = 0;
      gridBagConstraints15.gridy = 2;
      gridBagConstraints15.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints15.ipadx = 0;
      gridBagConstraints15.ipady = 10;

      jPanel.add(getJScrollPane(), gridBagConstraints15);
      jPanel.add(jLabel2, gridBagConstraints13);
      jPanel.add(getBtnCancel(), gridBagConstraints2);
      jPanel.add(getBtnAdd(), gridBagConstraints3);
    }
    return jPanel;
  }
Пример #30
0
  public LogViewInternalFrame(
      String name, JDesktopPane desktopPane, StatusObserver statusObserver) {
    this.name = name;
    this.desktopPane = desktopPane;
    this.statusObserver = statusObserver;
    dataTableModel = new LogDataTableModel();
    logViewPanel = new LogViewPanel(dataTableModel, statusObserver);

    cardLayout = new CardLayout();
    JPanel panelLoading = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(10, 10, 10, 10);
    c.anchor = GridBagConstraints.PAGE_START;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 0;
    c.gridy = 0;
    c.ipadx = 12;
    c.ipady = 12;
    JLabel label = new JLabel("Loading file " + name);
    panelLoading.add(label, c);

    c.gridy = 1;
    c.weighty = 5;
    c.weightx = 3;

    loadingProgressBar = new JProgressBar();
    loadingProgressBar.setIndeterminate(false);
    loadingProgressBar.setStringPainted(true);
    loadingProgressBar.setString("Connecting...");
    panelLoading.add(loadingProgressBar, c);

    iframe = new JInternalFrame(name, true, true, true, true);
    iframe.getContentPane().setLayout(cardLayout);
    iframe.getContentPane().add(panelLoading, CARD_LAYOUT_LOADING);
    iframe.getContentPane().add(logViewPanel, CARD_LAYOUT_CONTENT);
    cardLayout.show(iframe.getContentPane(), CARD_LAYOUT_LOADING);
    iframe.setBounds(50, 50, 200, 100);
    desktopPane.add(iframe);

    iframe.setVisible(true);
    iframe.pack();
    try {
      iframe.setMaximum(true);
    } catch (PropertyVetoException ignore) {
    }
  }