示例#1
0
 private void addCountFilter(final String label, final Integer value) {
   add(GuiBuilder.buildLabel(label, BOLD_12, null), Constraints.LBL_COUNT);
   final String valueStr = value != null ? value.toString() : "";
   txtCount = GuiBuilder.buildTextField(valueStr, Color.white);
   txtCount.setInputVerifier(
       new IntegerVerifier(txtCount, GuiConfig.getInstance().getTxtInvalidInteger()));
   add(txtCount, Constraints.TXT_COUNT);
 }
示例#2
0
  /**
   * Builds a new filter panel.
   *
   * @param tileFilter specifies if the tile or cluster filters needs to be displayed
   */
  FilterPanel(final boolean tileFilter) {
    super(new GridBagLayout());
    this.tileFilter = tileFilter;

    if (tileFilter) {
      final TileFilter filter =
          (TileFilter) PreferenceManager.getInstance().loadSearchFilter(TileFilter.class);
      addStatusFilter(filter.getStatus());
      addTypesFilter(filter.getTypes());
      addCountFilter(GuiConfig.getInstance().getLblTripCount(), filter.getNumberOfTrips());
    } else {
      final ClusterFilter filter =
          (ClusterFilter) PreferenceManager.getInstance().loadSearchFilter(ClusterFilter.class);
      addStatusFilter(filter.getStatus());
      addTypesFilter(filter.getTypes());
      addCountFilter(GuiConfig.getInstance().getLblPointCount(), filter.getNumberOfPoints());
    }
  }
示例#3
0
 private void addTypesFilter(final List<Type> types) {
   add(
       GuiBuilder.buildLabel(GuiConfig.getInstance().getDlgFilterLblType(), BOLD_12, null),
       Constraints.LBL_TYPE);
   cbTypeParking =
       GuiBuilder.buildCheckBox(Type.PARKING.displayValue(), Type.PARKING.name(), getBackground());
   cbTypeRoad =
       GuiBuilder.buildCheckBox(Type.ROAD.displayValue(), Type.ROAD.name(), getBackground());
   cbTypeBoth =
       GuiBuilder.buildCheckBox(Type.BOTH.displayValue(), Type.BOTH.name(), getBackground());
   selectTypes(types);
   add(cbTypeParking, Constraints.RB_PARKING);
   add(cbTypeRoad, Constraints.RB_ROAD);
   add(cbTypeBoth, Constraints.RB_BOTH);
 }
示例#4
0
 private void addStatusFilter(final Status status) {
   add(
       GuiBuilder.buildLabel(GuiConfig.getInstance().getDlgFilterLblStatus(), BOLD_12, null),
       Constraints.LBL_STATUS);
   rbStatusOpen =
       GuiBuilder.buildRadioButton(
           Status.OPEN.toString(), Status.OPEN.toString(), getBackground());
   rbStatusSolved =
       GuiBuilder.buildRadioButton(
           Status.SOLVED.toString(), Status.SOLVED.toString(), getBackground());
   rbStatusInvalid =
       GuiBuilder.buildRadioButton(
           Status.INVALID.toString(), Status.INVALID.toString(), getBackground());
   btnGroupStatus = GuiBuilder.buildButtonGroup(rbStatusOpen, rbStatusSolved, rbStatusInvalid);
   selectStatus(status);
   add(rbStatusOpen, Constraints.RB_OPEN);
   add(rbStatusSolved, Constraints.RB_SOLVED);
   add(rbStatusInvalid, Constraints.RB_INVALID);
 }