本文整理匯總了Java中org.piccolo2d.extras.nodes.PComposite.getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:Java PComposite.getAttribute方法的具體用法?Java PComposite.getAttribute怎麽用?Java PComposite.getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.piccolo2d.extras.nodes.PComposite
的用法示例。
在下文中一共展示了PComposite.getAttribute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drag
import org.piccolo2d.extras.nodes.PComposite; //導入方法依賴的package包/類
@Override
@SuppressWarnings({"unchecked"})
protected void drag(PInputEvent e) {
LOGGER.trace("Method drag("
+ e + ") called.");
PNode pickedNode = e.getPickedNode();
if (pickedNode instanceof PComposite) {
super.drag(e);
PComposite vNode = (PComposite) pickedNode;
/* Redraw edges */
ArrayList<PPath> vEdges = (ArrayList<PPath>) vNode.getAttribute("edges");
for (PPath vEdge : vEdges) {
mPanel.updateEdge(vEdge, (Position) vNode.getAttribute("position"));
}
/* TODO Redraw the shadow */
PPath vShadow = (PPath) vNode.getAttribute("glow");
if (vShadow != null) {
vShadow.setOffset(vNode.getOffset());
}
}
}
示例2: deleteNode
import org.piccolo2d.extras.nodes.PComposite; //導入方法依賴的package包/類
@Override
public synchronized void deleteNode(Position pPosition) {
LOGGER.trace("Method deleteNode("
+ pPosition + ") called.");
PComposite vNode = mMapNode.get(pPosition);
if (vNode != null) {
/* Delete node from layer */
mLayerNode.removeChild(vNode);
/* Remove Shadow */
PPath vShadow = (PPath) vNode.getAttribute("glow");
if (vShadow != null) {
mLayerGlow.removeChild(vShadow);
}
/* Metadata */
if (pPosition instanceof NodeMetadata) {
/* Delete edges from layer */
for (PPath vEdge : mMapEdge.get(pPosition)) {
deleteEdge(pPosition, vEdge);
}
/* Delete edge from HashMap */
mMapEdge.remove(pPosition);
}
/* Delete node from HashMap */
mMapNode.remove(pPosition);
}
}