Hello, first off I love Docking Frames its the best out there!
After a two year distraction I’ve come back to this project. Problem is int(drawAction) of the class below to class CDropDownItem.
public class DrawMenuAction extends CDropDownItem{
private DrawCAction drawAction;
String drawItem;
VisualATS v;
int item =0;
public DrawMenuAction(final VisualATS v, final String drawItem, int item){
super( null );
drawAction = new DrawCAction( this );
:stumm: init(drawAction);
this.drawItem = drawItem;
this.v=v;
this.item = item;
}
public void triggeredByMenu( CDockable dockable ){
switch (item) {
case 0 : …
DrawCAction looks like this:
public class DrawCAction extends SimpleDropDownItemAction implements StandardDropDownItemAction{
public static final ActionType DRAWACTION = new ActionType( “drawAction” );
private DrawMenuAction master;
public DrawCAction( DrawMenuAction master ){
this.master = master;
}
public DrawMenuAction getMaster(){
return master;
}
public <V> V createView( ViewTarget<V> target, ActionViewConverter converter, Dockable dockable ){
return converter.createView( DRAWACTION, this, target, dockable );
}
public boolean trigger( Dockable dockable ){
master.triggerByUnknown( ((CommonDockable)dockable).getDockable() );
return true;
}
}
I tried casting drawAction to CDecorateableAction, but does not work. Works well in the early API.
drawAction is added to a icon drop down action.
[QUOTE=glikar]Hello, first off I love Docking Frames its the best out there!
After a two year distraction I’ve come back to this project. Problem is int(drawAction) of the class below to class CDropDownItem.
public class DrawMenuAction extends CDropDownItem{
private DrawCAction drawAction;
String drawItem;
VisualATS v;
int item =0;
public DrawMenuAction(final VisualATS v, final String drawItem, int item){
super( null );
drawAction = new DrawCAction( this );
:stumm: init(drawAction);
this.drawItem = drawItem;
this.v=v;
this.item = item;
}
public void triggeredByMenu( CDockable dockable ){
switch (item) {
case 0 : …
DrawCAction looks like this:
public class DrawCAction extends SimpleDropDownItemAction implements StandardDropDownItemAction{
public static final ActionType DRAWACTION = new ActionType( “drawAction” );
private DrawMenuAction master;
public DrawCAction( DrawMenuAction master ){
this.master = master;
}
public DrawMenuAction getMaster(){
return master;
}
public <V> V createView( ViewTarget<V> target, ActionViewConverter converter, Dockable dockable ){
return converter.createView( DRAWACTION, this, target, dockable );
}
public boolean trigger( Dockable dockable ){
master.triggerByUnknown( ((CommonDockable)dockable).getDockable() );
return true;
}
}
I tried casting drawAction to CDecorateableAction, but does not work. Works well in the early API.
drawAction is added to a icon drop down action.
Can anyone help?[/QUOTE]
Maybe a screenshot will help. The above is added to the icons in the button bar on each docking frame.
Since you are upgrading: I suggest you go directly to the preview version of 1.1.2, it is close to 1.1.1 but with more bugfixes.
The issue is just a matter of replacing some interfaces and super classes. Btw.: the framework is built in a way that casting almost always indicates that you are doing something wrong
Replace these lines…
public class DrawCAction extends SimpleDropDownItemAction implements StandardDropDownItemAction```
... with these lines:
```// Additional generic parameter
public class DrawMenuAction extends CDropDownItem<DrawCAction>
// CommonDropDownItem because every child of a CDropDownItem must now implement this interface
// CommonSimpleButtonAction because it already implements CommonDropDownItem
// Actually in this case you could remove the "implements ..." because the super class already contains that code.
public class DrawCAction extends CommonSimpleButtonAction implements CommonDropDownItem