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;
}
}
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);
}
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();
}
}
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;
}
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);
}
Aggregations