Interface Parts


public interface Parts
Parts in one Cubism model.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Part
    add(PartId id)
    Creates a new Part under the root Part and returns it.
    default Part
    add(PartId id, PartId parentId)
    Creates a new Part under the requested parent Part and returns it.
    default Part
    add(String id)
    Creates a new Part under the root Part and returns it.
    default Part
    add(String id, PartId parentId)
    Creates a new Part under the requested parent Part and returns it.
    all()
     
    default Part
    Duplicates one Part (including its subtree) next to the source Part and returns the copy.
    default Part
    create(String name)
    Creates a Part with name and appends it under the model root.
    default Part
    create(String name, Part parent, int index)
    Creates a Part with name under parent at index (negative = append; null parent = model root).
     
    default void
    remove(Part part)
    Deletes part through the native selection + native DELETE command path.
    default void
    Deletes one Part and its entire subtree.
  • Method Details

    • all

      List<Part> all()
    • create

      default Part create(String name)
      Creates a Part with name and appends it under the model root.

      The native two-phase flow is used: construct CPartSource → add to the Part source set → attach to the Part tree, all admitted into one native Undo entry.

    • create

      default Part create(String name, Part parent, int index)
      Creates a Part with name under parent at index (negative = append; null parent = model root).
      Throws:
      IllegalArgumentException - when name is blank
    • remove

      default void remove(Part part)
      Deletes part through the native selection + native DELETE command path.
    • find

      Part find(PartId id)
      Throws:
      NoSuchElementException - when the ID is absent
    • add

      default Part add(String id)
      Creates a new Part under the root Part and returns it.

      The Part is created with the requested ID as its display name and the Editor default draw order. The write is undoable and generation-bound.

      Throws:
      IllegalArgumentException - when the ID is blank or already present
    • add

      default Part add(PartId id)
      Creates a new Part under the root Part and returns it.
      Throws:
      IllegalArgumentException - when the ID is blank or already present
    • add

      default Part add(String id, PartId parentId)
      Creates a new Part under the requested parent Part and returns it.
      Throws:
      IllegalArgumentException - when the ID is blank or already present
      NoSuchElementException - when the parent Part is absent
    • add

      default Part add(PartId id, PartId parentId)
      Creates a new Part under the requested parent Part and returns it.
      Throws:
      IllegalArgumentException - when the ID is blank or already present
      NoSuchElementException - when the parent Part is absent
    • copy

      default Part copy(PartId id)
      Duplicates one Part (including its subtree) next to the source Part and returns the copy.
      Throws:
      NoSuchElementException - when the source Part is absent
    • remove

      default void remove(PartId id)
      Deletes one Part and its entire subtree.
      Throws:
      NoSuchElementException - when the Part is absent