Exemplo n.º 1
0
 private void updateComponentStatus() {
   /*
    * enable/disable component by first checkbox
    */
   boolean enable = highlightSyntax.isSelected();
   for (JComponent c : componentSet) {
     c.setEnabled(enable);
   }
 }
Exemplo n.º 2
0
  private void updateEnabledState() {
    myLabelEditor.setEnabled(myRbExpressionLabel.isSelected());

    final boolean isChildrenExpression = myRbExpressionChildrenRenderer.isSelected();
    myChildrenExpandedEditor.setEnabled(isChildrenExpression);
    myExpandedLabel.setEnabled(isChildrenExpression);
    myChildrenEditor.setEnabled(isChildrenExpression);
    myChildrenListEditor.setEnabled(myRbListChildrenRenderer.isSelected());
  }
Exemplo n.º 3
0
    protected void configureEnableToggle(
        Boolean initiallyEnabled, String valueIfDisabled, final List<JComponent> components) {
      if (initiallyEnabled != null) {
        enable = new JCheckBox();
        boolean enabled = initiallyEnabled.booleanValue();
        this.enable.setSelected(enabled);
        for (JComponent c : components) {
          c.setEnabled(enabled);
        }
        this.valueIfDisabled = valueIfDisabled;

        final OptionField f = this;
        this.enable.addItemListener(
            new ItemListener() {
              @Override
              public void itemStateChanged(ItemEvent e) {
                for (JComponent c : components) {
                  c.setEnabled(f.isEnabled());
                }
                fireChangeEvent();
              }
            });
      }
    }
Exemplo n.º 4
0
    private void update() {
      for (JComponent c : onTerrainOnlyItems) {
        c.setEnabled(currentFollowTerrain);
      }

      for (JComponent c : offTerrainOnlyItems) {
        c.setEnabled(!currentFollowTerrain);
      }

      if (this.currentShape instanceof SurfaceShape) {
        SurfaceShape shape = (SurfaceShape) currentShape;
        ShapeAttributes attr = shape.getAttributes();

        if (attr == null) attr = new BasicShapeAttributes();

        if (!currentBorderStyle.equals("None")) {
          float alpha =
              currentBorderOpacity >= 10
                  ? 1f
                  : currentBorderOpacity <= 0 ? 0f : currentBorderOpacity / 10f;
          Color color = null;
          if (currentBorderColor.equals("Yellow")) color = new Color(1f, 1f, 0f);
          else if (currentBorderColor.equals("Red")) color = new Color(1f, 0f, 0f);
          else if (currentBorderColor.equals("Green")) color = new Color(0f, 1f, 0f);
          else if (currentBorderColor.equals("Blue")) color = new Color(0f, 0f, 1f);

          attr.setDrawOutline(true);
          attr.setOutlineMaterial(new Material(color));
          attr.setOutlineOpacity(alpha);
          attr.setOutlineWidth(currentBorderWidth);
        } else {
          attr.setDrawOutline(false);
        }

        if (!currentInteriorStyle.equals("None")) {
          float alpha =
              currentInteriorOpacity >= 10
                  ? 1f
                  : currentInteriorOpacity <= 0 ? 0f : currentInteriorOpacity / 10f;
          Color color = null;
          if (currentInteriorColor.equals("Yellow")) color = new Color(1f, 1f, 0f);
          else if (currentInteriorColor.equals("Red")) color = new Color(1f, 0f, 0f);
          else if (currentInteriorColor.equals("Green")) color = new Color(0f, 1f, 0f);
          else if (currentInteriorColor.equals("Blue")) color = new Color(0f, 0f, 1f);

          attr.setInteriorMaterial(new Material(color));
          attr.setInteriorOpacity(alpha);
          attr.setDrawInterior(true);
        } else {
          attr.setDrawInterior(false);
        }

        shape.setAttributes(attr);
      } else {
        float alpha =
            currentPathOpacity >= 10 ? 1f : currentPathOpacity <= 0 ? 0f : currentPathOpacity / 10f;
        Color color = null;
        if (currentPathColor.equals("Yellow")) color = new Color(1f, 1f, 0f, alpha);
        else if (currentPathColor.equals("Red")) color = new Color(1f, 0f, 0f, alpha);
        else if (currentPathColor.equals("Green")) color = new Color(0f, 1f, 0f, alpha);
        else if (currentPathColor.equals("Blue")) color = new Color(0f, 0f, 1f, alpha);

        if (currentShape instanceof Polyline) {
          Polyline pl = (Polyline) currentShape;
          pl.setColor(color);
          pl.setLineWidth(currentPathWidth);
          pl.setFollowTerrain(currentFollowTerrain);
          pl.setTerrainConformance(currentTerrainConformance);
          pl.setNumSubsegments(currentNumSubsegments);

          if (currentPathType.equalsIgnoreCase("linear")) pl.setPathType(Polyline.LINEAR);
          else if (currentPathType.equalsIgnoreCase("rhumb line"))
            pl.setPathType(Polyline.RHUMB_LINE);
          else pl.setPathType(Polyline.GREAT_CIRCLE);

          pl.setOffset(currentOffset);

          if (currentPathStyle.equals("Dash")) {
            pl.setStippleFactor(5);
            pl.setStipplePattern((short) 0xAAAA);
          } else {
            pl.setStippleFactor(0); // solid
          }
        }
      }
      this.layer.removeAllRenderables();
      if (this.currentShape != null) this.layer.addRenderable(this.currentShape);
      this.wwjPanel.getWwd().redraw();
    }
Exemplo n.º 5
0
 public void enableElements() {
   visibleComponent.setEnabled(true);
   icon.setEnabled(true);
 }
Exemplo n.º 6
0
 public void disableElements() {
   visibleComponent.setEnabled(false);
   icon.setEnabled(false);
 }
 public void setEnabled(boolean b) {
   super.setEnabled(b);
   for (Component c : getComponents()) {
     c.setEnabled(b);
   }
 }