Home › Forums › Icy Kernel › detect if viewer is selected/deselected: how? › Reply To: detect if viewer is selected/deselected: how?
I guess that you use 2 separates Sequence (and so viewer) or you have many of them which can be from one type or another ? In the second case what you can do is to eventually use a specific mark in the Sequence name (or is its metadata ?) so instead of using the viewer event you directly use the sequence event.
Here’s how you can store an information in Sequence metadata (persitent with the XML file):
Node myNode = sequence.getNode(“myPluginMetadata”);
// set type
XMLUtil.setElementValue(myNode, “type”, “type1”);
Then how use it for sequence activation event:
Icy.getMainInterface().addActiveSequenceListener(new ActiveSequenceListener()
{
@Override
public void sequenceDeactivated(Sequence sequence)
{
Node myNode = sequence.getNode(“myPluginMetadata”);
// get sequence ‘type’
if (XMLUtil.getElementValue(myNode, “type”, “”).equals(“typeA”))
// do something
}
@Override
public void sequenceActivated(Sequence sequence)
{
Node myNode = sequence.getNode(“myPluginMetadata”);
// get sequence ‘type’
if (XMLUtil.getElementValue(myNode, “type”, “”).equals(“typeA”))
// do something
}
@Override
public void activeSequenceChanged(SequenceEvent event)
{
// TODO Auto-generated method stub
}
});
-
This reply was modified 7 years, 5 months ago by
Stephane Dallongeville.
-
This reply was modified 7 years, 5 months ago by
Stephane Dallongeville.
-
This reply was modified 7 years, 5 months ago by
Stephane Dallongeville.
-
This reply was modified 7 years, 5 months ago by
Stephane Dallongeville.
-
This reply was modified 7 years, 5 months ago by
Stephane Dallongeville.