本文整理汇总了Java中prefuse.action.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于prefuse.action包,在下文中一共展示了Action类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disposeAction
import prefuse.action.Action; //导入依赖的package包/类
/**
* Disposes the specified action and its member actions recursively (if it is a {@link CompositeAction}).
*
* @param action
* the action to dispose
*/
public static void disposeAction( Action action )
{
if ( action == null )
return;
action.cancel();
action.setEnabled( false );
action.setVisualization( null );
if ( action instanceof CompositeAction ) {
CompositeAction ca = (CompositeAction)action;
for ( int i = ca.size() - 1; i >= 0; --i ) {
disposeAction( ca.remove( i ) );
}
}
}
示例2: animate
import prefuse.action.Action; //导入依赖的package包/类
public void animate(boolean enable) {
Action a = m_vis.getAction("layout");
if (a != null) {
a.setEnabled(enable);
}
if (!enable) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
示例3: getZoomToFitAction
import prefuse.action.Action; //导入依赖的package包/类
private Action getZoomToFitAction() {
return(new Action() {
@Override
public void run(double frac) {
Rectangle2D bounds = m_vis.getBounds(Visualization.ALL_ITEMS);
Display display = m_vis.getDisplay(0);
GraphicsLib.expand(bounds, 50 + (int)(1/display.getScale()));
DisplayLib.fitViewToBounds(display, bounds, 2000);
}
});
}
示例4: InstanceGraph
import prefuse.action.Action; //导入依赖的package包/类
public InstanceGraph() {
gControl = new InstanceGraphControl();
gView = new GraphView(gControl.getGraph(), "name", null);
gView.getVisualization().putAction("updateGraph", new Action() {
@Override
public void run(double frac) {
gControl.updateGraph();
}
});
add(gView);
}
示例5: setCurrentLayout
import prefuse.action.Action; //导入依赖的package包/类
public void setCurrentLayout(LayoutInfo currentLayout) {
// 切换布局管理器
currentLayout.getLayout().setLayoutBounds(new Rectangle(this.display.getWidth(), this.display.getHeight()));
Action treeLayout = this.display.getVisualization().getAction("treeLayout");
this.display.getVisualization().putAction("treeLayout", currentLayout.getLayout());
ActionList filter = (ActionList) this.display.getVisualization().getAction("filter");
filter.remove(treeLayout);
filter.add(currentLayout.getLayout());
this.currentLayout = currentLayout;
this.deleteSpecifiedPosition();
}
示例6: run
import prefuse.action.Action; //导入依赖的package包/类
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
Object[] actions = m_activities.getArray();
for ( int i=0; i<actions.length; ++i ) {
Action a = (Action)actions[i];
try {
if ( a.isEnabled() ) a.run(frac);
} catch ( Exception e ) {
// s_logger.warning(e.getMessage() + '\n'
// + StringLib.getStackTrace(e));
}
}
}
示例7: findRelevantParameters
import prefuse.action.Action; //导入依赖的package包/类
public synchronized void findRelevantParameters(ArrayList<Integer> axes,ArrayList<ValuedRangeModel> rangeModels,
ArrayList<Integer> axisTypes,ArrayList<Double> minPositions,ArrayList<Double> maxPositions) {
for(String iKey : relevantActionLists) {
Activity iAc = m_vis.getAction(iKey);
if (iAc instanceof ActionList) {
for (int i=0; i<((ActionList)iAc).size(); i++) {
Action iAc2 = ((ActionList)iAc).get(i);
if(iAc2 instanceof AxisLayout && axes.contains(((AxisLayout)iAc2).getAxis())) {
if (!rangeModels.contains(((AxisLayout)iAc2).getRangeModel())) {
rangeModels.add(((AxisLayout)iAc2).getRangeModel());
axisTypes.add(((AxisLayout)iAc2).getAxis());
minPositions.add(((AxisLayout)iAc2).getAxis() == Constants.X_AXIS ? ((AxisLayout)iAc2).getLayoutBounds().getMinX() : ((AxisLayout)iAc2).getLayoutBounds().getMinY());
maxPositions.add(((AxisLayout)iAc2).getAxis() == Constants.X_AXIS ? ((AxisLayout)iAc2).getLayoutBounds().getMaxX() : ((AxisLayout)iAc2).getLayoutBounds().getMaxY());
}
} else if(iAc2 instanceof RangeModelTransformationProvider) {
for(int iAx : ((RangeModelTransformationProvider)iAc2).getAxes()) {
if (!rangeModels.contains(((RangeModelTransformationProvider)iAc2).getRangeModel(iAx))) {
rangeModels.add(((RangeModelTransformationProvider)iAc2).getRangeModel(iAx));
axisTypes.add(iAx);
minPositions.add(((RangeModelTransformationProvider)iAc2).getMinPosition(iAx));
maxPositions.add(((RangeModelTransformationProvider)iAc2).getMaxPosition(iAx));
}
}
}
}
}
}
}
示例8: animate
import prefuse.action.Action; //导入依赖的package包/类
public void animate(boolean enable) {
Action a = m_vis.getAction("layout");
if (a != null) {
a.setEnabled(enable);
}
}
示例9: getLockAction
import prefuse.action.Action; //导入依赖的package包/类
public Action getLockAction()
{
return new LockAction(this);
}
示例10: getUnlockAction
import prefuse.action.Action; //导入依赖的package包/类
public Action getUnlockAction()
{
return new UnlockAction(this);
}
示例11: removeAction
import prefuse.action.Action; //导入依赖的package包/类
/**
* Remove a data processing Action registered with this visualization.
* If the removed action is currently running, it will be canceled.
* The visualization reference held by the removed Action will be set to
* null.<br/>
* <strong>NOTE:</strong> Errors may occur if the removed Action is
* included in an "always run after" relation with another registered
* Action that has not been removed from this visualization. It is the
* currently the responsibility of clients to avoid this situation.
* @param name the name of the Action
* @return the removed Action, or null if no action was found
*/
public Action removeAction(String name) {
// TODO: create registry of always run after relations to automatically
// resolve action references?
Action a = getAction(name);
if ( a != null ) {
a.cancel();
m_actions.remove(name);
a.setVisualization(null);
}
return a;
}
示例12: putAction
import prefuse.action.Action; //导入依赖的package包/类
/**
* Add a data processing Action to this Visualization. The Action will be
* updated to use this Visualization in its data processing.
* @param name the name of the Action
* @param action the Action to add
*/
public Action putAction(String name, Action action) {
action.setVisualization(this);
m_actions.put(name, action);
return action;
}
示例13: getAction
import prefuse.action.Action; //导入依赖的package包/类
/**
* Get the data processing Action with the given name.
* @param name the name of the Action
* @return the requested Action, or null if the name was not found
*/
public Action getAction(String name) {
return (Action)m_actions.get(name);
}