Search in sources :

Example 1 with FlamePropertyPath

use of org.jwildfire.create.tina.dance.model.FlamePropertyPath in project JWildfire by thargor6.

the class IFlamesController method fillMutationFields.

private void fillMutationFields(Flame pFlame, double pParamMin, double pParamMax, String pParamPath) {
    paramMinValueField.setValue(pParamMin);
    paramMaxValueField.setValue(pParamMax);
    boolean oldNoRefresh = noRefresh;
    noRefresh = true;
    try {
        if (pParamPath == null || pParamPath.length() == 0 || pFlame == null) {
            paramPropertyPathTree.clearSelection();
        } else {
            FlamePropertyPath path = new FlamePropertyPath(pFlame, pParamPath);
            flamePropertiesTreeService.selectPropertyPath(paramPropertyPathTree, path);
        }
    } finally {
        noRefresh = oldNoRefresh;
    }
}
Also used : FlamePropertyPath(org.jwildfire.create.tina.dance.model.FlamePropertyPath)

Example 2 with FlamePropertyPath

use of org.jwildfire.create.tina.dance.model.FlamePropertyPath in project JWildfire by thargor6.

the class DancingFractalsController method enableControls.

private void enableControls() {
    loadSoundBtn.setEnabled(!running);
    addFromClipboardBtn.setEnabled(!running);
    addFromEditorBtn.setEnabled(!running);
    addFromDiscBtn.setEnabled(!running);
    randomCountIEd.setEnabled(!running);
    genRandFlamesBtn.setEnabled(!running);
    randomGenCmb.setEnabled(!running);
    boolean flameSelected = poolFlameHolder.getFlame() != null;
    flameToEditorBtn.setEnabled(flameSelected);
    deleteFlameBtn.setEnabled(flameSelected);
    renameFlameBtn.setEnabled(flameSelected);
    replaceFlameFromEditorBtn.setEnabled(flameSelected);
    framesPerSecondIEd.setEnabled(!running);
    borderSizeSlider.setEnabled(true);
    morphFrameCountIEd.setEnabled(true);
    startShowButton.setEnabled(!running && project.getFlames().size() > 0);
    stopShowButton.setEnabled(running);
    doRecordCBx.setEnabled(!running);
    motionTable.setEnabled(!running);
    addMotionCmb.setEnabled(!running);
    addMotionBtn.setEnabled(!running);
    Motion selMotion = getSelectedMotion();
    deleteMotionBtn.setEnabled(!running && selMotion != null);
    renameMotionBtn.setEnabled(deleteMotionBtn.isEnabled());
    boolean plainPropertySelected = flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree);
    {
        boolean linkMotionEnabled = false;
        if (!running && selMotion != null && selMotion.getParent() == null) {
            if (plainPropertySelected) {
                FlamePropertyPath selPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
                linkMotionEnabled = !selMotion.hasLink(selPath);
            }
        }
        linkMotionBtn.setEnabled(linkMotionEnabled);
        unlinkMotionBtn.setEnabled(selMotion != null && motionLinksTable.getSelectedRow() >= 0 && motionLinksTable.getSelectedRow() < selMotion.getMotionLinks().size());
    }
    createMotionsCmb.setEnabled(!running);
    clearMotionsBtn.setEnabled(!running && project.getMotions().size() > 0);
    loadProjectBtn.setEnabled(!running);
    saveProjectBtn.setEnabled(!running);
}
Also used : Motion(org.jwildfire.create.tina.dance.motion.Motion) FlamePropertyPath(org.jwildfire.create.tina.dance.model.FlamePropertyPath)

Example 3 with FlamePropertyPath

use of org.jwildfire.create.tina.dance.model.FlamePropertyPath in project JWildfire by thargor6.

the class DancingFractalsController method linkMotionBtn_clicked.

public void linkMotionBtn_clicked() {
    Motion currMotion = getSelectedMotion();
    if (currMotion != null && flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree)) {
        FlamePropertyPath propertyPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
        currMotion.getMotionLinks().add(new MotionLink(propertyPath));
        refreshMotionLinksTable();
        int selectRow = currMotion.getMotionLinks().size() - 1;
        motionLinksTable.getSelectionModel().setSelectionInterval(selectRow, selectRow);
        enableControls();
    }
}
Also used : Motion(org.jwildfire.create.tina.dance.motion.Motion) MotionLink(org.jwildfire.create.tina.dance.motion.MotionLink) FlamePropertyPath(org.jwildfire.create.tina.dance.model.FlamePropertyPath)

Example 4 with FlamePropertyPath

use of org.jwildfire.create.tina.dance.model.FlamePropertyPath in project JWildfire by thargor6.

the class FlamePropertiesTreeService method getSelectedPropertyPath.

public FlamePropertyPath getSelectedPropertyPath(JTree pFlamePropertiesTree) {
    if (pFlamePropertiesTree.getSelectionPath() != null) {
        Object[] selection = pFlamePropertiesTree.getSelectionPath().getPath();
        if (selection != null && selection.length > 1) {
            @SuppressWarnings("unchecked") FlamePropertiesTreeNode<Flame> // skip root node which is only a text node
            flameNode = (FlamePropertiesTreeNode<Flame>) selection[1];
            List<String> path = new ArrayList<String>();
            for (int i = 2; i < selection.length; i++) {
                FlamePropertiesTreeNode<?> node = (FlamePropertiesTreeNode<?>) selection[i];
                path.add(((AbstractProperty) node.getNodeData()).getName());
            }
            FlamePropertyPath res = new FlamePropertyPath(flameNode.getNodeData(), path);
            return res;
        }
    }
    return null;
}
Also used : ArrayList(java.util.ArrayList) Flame(org.jwildfire.create.tina.base.Flame) FlamePropertyPath(org.jwildfire.create.tina.dance.model.FlamePropertyPath)

Example 5 with FlamePropertyPath

use of org.jwildfire.create.tina.dance.model.FlamePropertyPath in project JWildfire by thargor6.

the class DefaultMotionCreator method addXFormLink.

protected void addXFormLink(PropertyModel pModel, Motion pMotion, Flame pFlame, int pLayerIdx, int pXFormIndex, String pPropname) {
    FlamePropertyPath path = new FlamePropertyPath(pFlame, AnimationModelService.createXFormPropertyPath(pLayerIdx, pXFormIndex, pPropname));
    MotionLink link = new MotionLink(path);
    pMotion.getMotionLinks().add(link);
}
Also used : FlamePropertyPath(org.jwildfire.create.tina.dance.model.FlamePropertyPath)

Aggregations

FlamePropertyPath (org.jwildfire.create.tina.dance.model.FlamePropertyPath)7 Motion (org.jwildfire.create.tina.dance.motion.Motion)2 ArrayList (java.util.ArrayList)1 Flame (org.jwildfire.create.tina.base.Flame)1 MotionLink (org.jwildfire.create.tina.dance.motion.MotionLink)1