コード例 #1
0
  protected AbstractTerminalNumericField(
      final ITerminalContext tc,
      final String name,
      final int displayType,
      final float fontSize,
      final boolean withButtons,
      final boolean withLabel,
      final String constr) {
    super(tc);

    this.name = name;
    this.displayType = displayType;
    if (fontSize > 0) {
      this.fontSize = fontSize;
    } else {
      this.fontSize = tc.getDefaultFontSize();
    }

    this.withButtons = withButtons;
    this.withLabel = withLabel;
    if (!Check.isEmpty(constr, true)) {
      constraints = constr;
    }

    initComponents();
    initUI();
    setValue(Env.ZERO, false);
  }
コード例 #2
0
  protected TerminalTable(final ITerminalContext tc) {
    super();

    this.tc = tc;
    this.listeners = tc.createPropertyChangeSupport(this);

    setRowSelectionAllowed(true);
    setColumnSelectionAllowed(false);
    setMultiSelection(false);
    setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    setRowHeight(ROW_SIZE);
    setAutoResize(false);
    setFocusable(false);
    setFillsViewportHeight(true); // @Trifon
    growScrollbars();

    getSelectionModel().addListSelectionListener(selectionListener);
  }