示例#1
0
 public boolean calculate() throws SQLException {
   boolean ok = false;
   Object[] results = validacion.checkConsistenciaHI_HR(id_concurso);
   ok = (Boolean) results[0];
   if ((Boolean) results[0]) {
     labEstado.setText("Passed HI-HR test");
   } else {
     labEstado.setText("Failed HI-HR test");
     ArrayList<String[]> al = (ArrayList<String[]>) results[3];
     String[][] data = new String[al.size()][1];
     for (int i = 0; i < al.size(); i++) {
       data[i] = al.get(i);
     }
     String[] columnNames = {"Correlativo", "LitoCodigo", "Codigo Postulante", "Nro Aula"};
     tableHIs = new JTable(new HITableModel(data, columnNames));
     spHI.setViewportView(tableHIs);
     tableHIs.revalidate();
     ArrayList<String> al2 = (ArrayList<String>) results[4];
     data = new String[al2.size()][1];
     for (int i = 0; i < al2.size(); i++) {
       data[i][0] = al2.get(i);
     }
     tableHRs = new JTable(new HITableModel(data, new String[] {"LitoCodigo"}));
     spHR.setViewportView(tableHRs);
     tableHRs.revalidate();
     setVisible(false);
     setVisible(true);
     //                System.err.println(fillDashes("-", guiones));
   }
   labHI.setText(results[1] + "");
   labHR.setText(results[2] + "");
   return ok;
 }
示例#2
0
  /** Sets the call stack with the given vector of method names. */
  public void setContents(Vector newMethodNames) {
    methodNames = (Vector) newMethodNames.clone();
    callStackTable.revalidate();

    Rectangle r = callStackTable.getCellRect(newMethodNames.size() - 1, 0, true);
    callStackTable.scrollRectToVisible(r);
    repaint();
  }
  private void setSizeAndDimensions(
      @NotNull JTable table,
      @NotNull JBPopup popup,
      @NotNull RelativePoint popupPosition,
      @NotNull List<UsageNode> data) {
    JComponent content = popup.getContent();
    Window window = SwingUtilities.windowForComponent(content);
    Dimension d = window.getSize();

    int width = calcMaxWidth(table);
    width = (int) Math.max(d.getWidth(), width);
    Dimension headerSize = ((AbstractPopup) popup).getHeaderPreferredSize();
    width = Math.max((int) headerSize.getWidth(), width);
    width = Math.max(myWidth, width);

    if (myWidth == -1) myWidth = width;
    int newWidth = Math.max(width, d.width + width - myWidth);

    myWidth = newWidth;

    int rowsToShow = Math.min(30, data.size());
    Dimension dimension = new Dimension(newWidth, table.getRowHeight() * rowsToShow);
    Rectangle rectangle = fitToScreen(dimension, popupPosition, table);
    dimension = rectangle.getSize();
    Point location = window.getLocation();
    if (!location.equals(rectangle.getLocation())) {
      window.setLocation(rectangle.getLocation());
    }

    if (!data.isEmpty()) {
      TableScrollingUtil.ensureSelectionExists(table);
    }
    table.setSize(dimension);
    // table.setPreferredSize(dimension);
    // table.setMaximumSize(dimension);
    // table.setPreferredScrollableViewportSize(dimension);

    Dimension footerSize = ((AbstractPopup) popup).getFooterPreferredSize();

    int newHeight =
        (int) (dimension.height + headerSize.getHeight() + footerSize.getHeight())
            + 4 /* invisible borders, margins etc*/;
    Dimension newDim = new Dimension(dimension.width, newHeight);
    window.setSize(newDim);
    window.setMinimumSize(newDim);
    window.setMaximumSize(newDim);

    window.validate();
    window.repaint();
    table.revalidate();
    table.repaint();
  }
示例#4
0
 /** Resets the contents of this CallStackComponent. */
 public void reset() {
   methodNames.removeAllElements();
   callStackTable.revalidate();
   callStackTable.clearSelection();
 }
 /** Called when revalidate is required. */
 public void revalidateChange() {
   segmentTable.revalidate();
   repaint();
 }
 /** Sets the start address. */
 public void setStartAddress(int index) {
   startAddress = index;
   segmentTable.revalidate();
 }