示例#1
0
 public boolean[] getColumnInsertability() {
   boolean[] result = new boolean[getColumnSpan()];
   int i = 0;
   Iterator iter = getColumnIterator();
   while (iter.hasNext()) {
     Selectable s = (Selectable) iter.next();
     result[i++] = !s.isFormula();
   }
   return result;
 }
示例#2
0
 static void blinkMenu(final Selectable selectable) {
   if (!animationsEnabled()) return;
   try {
     selectable.paintSelected(false);
     Thread.sleep(MENU_BLINK_DELAY);
     selectable.paintSelected(true);
     Thread.sleep(MENU_BLINK_DELAY);
   } catch (final InterruptedException ignored) {
   }
 }
示例#3
0
 private static boolean pickingInFrustum(
     Selectable selectable,
     float[][] frustum,
     float z_offset,
     float selection_radius,
     float selection_height) {
   picking_selection_box.setBounds(
       -selection_radius + selectable.getPositionX(),
       selection_radius + selectable.getPositionX(),
       -selection_radius + selectable.getPositionY(),
       selection_radius + selectable.getPositionY(),
       z_offset,
       z_offset + selection_height);
   return RenderTools.inFrustum(picking_selection_box, frustum) >= RenderTools.IN_FRUSTUM;
 }
  public void select(Object o, Layer parentLayer, Position pickPosition) {
    if (this.selectedAnnotLayer == null) {
      selectedAnnotLayer = new SelectedAnnotationLayer();
      selectedAnnotLayer.setEnabled(true);
      selectedAnnotLayer.setName("Layers.SelectedFeatureAnnotationLayer");

      wwd.getModel().getLayers().add(selectedAnnotLayer);
    } // if

    synchronized (selectedAnnotLayer) {
      // unselect the currently selected object
      unselect();

      // select o
      if (null != o) {
        if (o instanceof Annotation) {
          Annotation ann = (Annotation) o;

          this.savedAnnotationBorderColor = ann.getAttributes().getBorderColor();
          ann.getAttributes().setBorderColor(SELECTED_ANNOTATION_BORDER_COLOR);
          storeSelection(o, parentLayer);
        } else if (o instanceof Selectable) {
          ((Selectable) o).select(this.wwd, this.selectedAnnotLayer, pickPosition);
          storeSelection(o, parentLayer);
        } else {
          Logging.logger().severe("Unsupported object type selected!");
        }
      }
    }
  }
示例#5
0
  public void selectItem(Selectable item, String selectEvent, String deselectEvent) {
    // don't do anything if the item is already selected
    if (item == selectedItem) return;

    // deselect the currently selected item
    if (this.selectedItem != null) {
      selectedItem.setSelected(false);
      fireEvent(selectedItem, deselectEvent);
    }

    selectedItem = item;

    // repaint
    this.repaint();

    if (item == null) return;

    // select and store the item
    item.setSelected(true);

    // tell interested parties that we've done this
    fireEvent(item, selectEvent);
  }
示例#6
0
 private void visitSelectable(
     ModelVisitor visitor,
     Selectable selectable,
     float z_offset,
     float selection_radius,
     float selection_height) {
   boolean in_view =
       !picking
           || (selectable.isEnabled()
               && (visible_override
                   || pickingInFrustum(
                       selectable,
                       camera.getFrustum(),
                       z_offset,
                       selection_radius,
                       selection_height)));
   if (in_view) {
     Player owner = selectable.getOwnerNoCheck();
     boolean point_on_map =
         !local_player.isEnemy(owner)
             || (!owner.teamHasBuilding()
                 && PeerHub.getFreeQuitTimeLeft(local_player.getWorld()) < 0f);
     ModelState state = getCachedState(visitor, selectable, z_offset);
     int sort_status = addToRenderList(state, point_on_map);
     if (!picking && selectable.isEnabled() && sort_status == SpriteSorter.DETAIL_POLYGON) {
       SelectableShadowRenderer shadow_renderer =
           (SelectableShadowRenderer)
               render_queues.getShadowRenderer(
                   selectable.getTemplate().getSelectableShadowRenderer());
       if (isHovered(selectable) || isSelected(selectable)) {
         shadow_renderer.addToSelectionList(state);
       } else {
         shadow_renderer.addToShadowList(state);
       }
     }
   }
 }
 public void addColumns(Iterator columnIterator) {
   while (columnIterator.hasNext()) {
     Selectable col = (Selectable) columnIterator.next();
     if (!col.isFormula()) addColumn((Column) col);
   }
 }
package bus.uigen.controller;
示例#9
0
 public static void selectableMethods(Selectable selectable) {
   selectable.onSelect();
 }