Example #1
0
  public void selectNext() {
    Iterator i = new SelectionIterator(this);

    if (m_actives.size() == 1) {
      boolean isFound = false;

      // loop the iterator in reverse order of drawing
      while (i.hasNext()) {
        GlyphObject object = (GlyphObject) i.next();

        if (m_actives.isSelected(object)) {
          isFound = true;
          continue;
        } // if

        if (!isFound) {
          continue;
        } // if

        m_actives.unselectAll();
        m_actives.addActive(object);
        return;
      } // while i
    } // if

    i = new SelectionIterator(this);
    if (i.hasNext()) {
      GlyphObject object = (GlyphObject) i.next();
      m_actives.unselectAll();
      m_actives.addActive(object);
      return;
    } // if
  }
Example #2
0
 public void display(Graphics2D g, AffineTransform a_trans) {
   Iterator i = createIterator();
   while (i.hasNext()) {
     GlyphObject object = (GlyphObject) i.next();
     object.display(g, a_trans);
   } // while
 }
Example #3
0
  /**
   * converts this glyph into Shape. It could be called for root's preview mode or by include
   * invoke. Pushing either this GlyphFile or DIncludeInvoke should be handled before this.
   */
  public Shape toShape(AffineTransform a_trans) {

    int ppem = k_defaultPixelSize;

    GeneralPath retval = new GeneralPath();
    Iterator i = createIterator();
    while (i.hasNext()) {
      GlyphObject object = (GlyphObject) i.next();

      if (object instanceof EContourPoint || object instanceof EHint) {
        continue;
      } // if

      retval.append(object.toShape(a_trans, ppem), false);
    } // if

    return retval;
  }
Example #4
0
  private boolean hitObjects(Rectangle2D a_rect, boolean a_isSelectOnlyOne) {
    boolean retval = false;

    Iterator i = new SelectionIterator(this);

    // loop the iterator in reverse order of drawing
    while (i.hasNext()) {
      GlyphObject object = (GlyphObject) i.next();

      if (!object.hit(a_rect, new AffineTransform())) {
        continue;
      } // if

      retval = true;

      if (a_isSelectOnlyOne) {
        return true;
      } // if
    } // while i

    return retval;
  }