Commit 44814a41 authored by Claes Sjofors's avatar Claes Sjofors

Android app, AppLink object handles, class help and URL's

parent 3481feb2
...@@ -3,6 +3,9 @@ package jpwr.app; ...@@ -3,6 +3,9 @@ package jpwr.app;
import android.graphics.Bitmap; import android.graphics.Bitmap;
public class AGraphInfo { public class AGraphInfo {
public static final int TYPE_GRAPH = 0;
public static final int TYPE_LINK = 1;
public int type;
public Bitmap bpm; public Bitmap bpm;
public Bitmap bpmInverted; public Bitmap bpmInverted;
public String graph; public String graph;
......
...@@ -12,6 +12,8 @@ public class AXttItemAttrObject extends AXttItemBase { ...@@ -12,6 +12,8 @@ public class AXttItemAttrObject extends AXttItemBase {
int flags; int flags;
int type; int type;
PwrtAttrRef aref; PwrtAttrRef aref;
int classid;
AXttItemAttrObject(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type, AXttItemAttrObject(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
...@@ -30,6 +32,8 @@ public class AXttItemAttrObject extends AXttItemBase { ...@@ -30,6 +32,8 @@ public class AXttItemAttrObject extends AXttItemBase {
CdhrTypeId cr = axtt.gdh.getAttrRefTid( ar.aref); CdhrTypeId cr = axtt.gdh.getAttrRefTid( ar.aref);
if ( cr.evenSts()) return; if ( cr.evenSts()) return;
classid = cr.typeId;
CdhrObjid coidret = axtt.gdh.classIdToObjid(cr.typeId); CdhrObjid coidret = axtt.gdh.classIdToObjid(cr.typeId);
if ( coidret.evenSts()) return; if ( coidret.evenSts()) return;
...@@ -110,4 +114,7 @@ public class AXttItemAttrObject extends AXttItemBase { ...@@ -110,4 +114,7 @@ public class AXttItemAttrObject extends AXttItemBase {
public PwrtAttrRef getAttrRef() { public PwrtAttrRef getAttrRef() {
return aref; return aref;
} }
public int getClassId() {
return classid;
}
} }
...@@ -229,4 +229,7 @@ public class AXttItemObject extends AXttItemBase { ...@@ -229,4 +229,7 @@ public class AXttItemObject extends AXttItemBase {
} }
} }
public int getClassId() {
return classid;
}
} }
...@@ -116,9 +116,16 @@ public class OpwinCmn implements PlowCmnIfc { ...@@ -116,9 +116,16 @@ public class OpwinCmn implements PlowCmnIfc {
switch (action) { switch (action) {
case PlowCmnIfc.ACTION_UP: case PlowCmnIfc.ACTION_UP:
if ( currentGraph != null) { if ( currentGraph != null) {
if ( currentGraph.type == AGraphInfo.TYPE_GRAPH) {
String cmd = "open graph " + currentGraph.graph; String cmd = "open graph " + currentGraph.graph;
if ( Math.abs(fx - downX) < 10 && Math.abs(fy - downY) < 10) if ( Math.abs(fx - downX) < 10 && Math.abs(fy - downY) < 10)
appl.command(cmd); appl.command(cmd);
}
else if ( currentGraph.type == AGraphInfo.TYPE_LINK) {
String cmd = new String("open url \"" + currentGraph.graph + "\"");
if ( Math.abs(fx - downX) < 10 && Math.abs(fy - downY) < 10)
appl.command(cmd);
}
currentGraph.inverted = false; currentGraph.inverted = false;
currentGraph = null; currentGraph = null;
} }
......
...@@ -536,6 +536,13 @@ public class GlowDraw implements GlowDrawIfc { ...@@ -536,6 +536,13 @@ public class GlowDraw implements GlowDrawIfc {
return 1; return 1;
} }
public void set_clip() {
if ( clipCount > 0) {
canvas.clipRect(clip_x1[clipCount-1], clip_y1[clipCount-1],
clip_x2[clipCount-1], clip_y2[clipCount-1], Region.Op.REPLACE);
}
}
public void reset_clip_rectangle() { public void reset_clip_rectangle() {
if ( clipCount == 0) { if ( clipCount == 0) {
System.out.println("Clip mismatch"); System.out.println("Clip mismatch");
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
package jpwr.jopg; package jpwr.jopg;
import java.awt.*;
import android.graphics.Canvas; import android.graphics.Canvas;
...@@ -63,4 +62,5 @@ public interface GlowDrawIfc { ...@@ -63,4 +62,5 @@ public interface GlowDrawIfc {
public int getColor(int gc_type); public int getColor(int gc_type);
public int set_clip_rectangle( int x1, int y1, int x2, int y2); public int set_clip_rectangle( int x1, int y1, int x2, int y2);
public void reset_clip_rectangle(); public void reset_clip_rectangle();
public void set_clip();
} }
...@@ -87,6 +87,7 @@ public class GrowFrame implements GraphApplIfc { ...@@ -87,6 +87,7 @@ public class GrowFrame implements GraphApplIfc {
public boolean isAuthorized(int access) { public boolean isAuthorized(int access) {
return false; return false;
} }
public void openPopupMenu( String object, double x, double y) {}
} }
......
This diff is collapsed.
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
android:id="@+id/alarmack_option" android:id="@+id/alarmack_option"
android:title="Alarm Acknowledge" android:title="Alarm Acknowledge"
android:icon="@drawable/xnav_openobject"/> android:icon="@drawable/xnav_openobject"/>
<item
android:id="@+id/helpclass_option"
android:title="Help Class"
android:icon="@drawable/xnav_openobject"/>
<item <item
android:id="@+id/changevalue_option" android:id="@+id/changevalue_option"
android:title="Change Value"/> android:title="Change Value"/>
......
...@@ -50,6 +50,7 @@ public class GrowCtx implements GrowCtxIfc { ...@@ -50,6 +50,7 @@ public class GrowCtx implements GrowCtxIfc {
double node_move_last_y; double node_move_last_y;
double slider_cursor_offset; double slider_cursor_offset;
boolean trace_started = false; boolean trace_started = false;
boolean drawing = false;
public GrowCtx(GrowApplIfc appl) { public GrowCtx(GrowApplIfc appl) {
cmn = new GrowCmn( this, appl); cmn = new GrowCmn( this, appl);
...@@ -366,6 +367,7 @@ public class GrowCtx implements GrowCtxIfc { ...@@ -366,6 +367,7 @@ public class GrowCtx implements GrowCtxIfc {
} }
public void draw() { public void draw() {
drawing = true;
// Draw background color // Draw background color
// draw.fillRect(0, 0, cmn.mw.window_width, cmn.mw.window_height, background_color); // draw.fillRect(0, 0, cmn.mw.window_width, cmn.mw.window_height, background_color);
// Draw connections // Draw connections
...@@ -378,10 +380,14 @@ public class GrowCtx implements GrowCtxIfc { ...@@ -378,10 +380,14 @@ public class GrowCtx implements GrowCtxIfc {
if ( ((GlowArrayElem)cmn.a.get(i)).type() != Glow.eObjectType_Con) if ( ((GlowArrayElem)cmn.a.get(i)).type() != Glow.eObjectType_Con)
((GlowArrayElem)cmn.a.get(i)).draw(); ((GlowArrayElem)cmn.a.get(i)).draw();
} }
drawing = false;
} }
public void draw( double ll_x, double ll_y, double ur_x, double ur_y) { public void draw( double ll_x, double ll_y, double ur_x, double ur_y) {
// TODO // TODO
if ( drawing)
return;
for ( int i = 0; i < cmn.a.size(); i++) { for ( int i = 0; i < cmn.a.size(); i++) {
if ( ((GlowArrayElem)cmn.a.get(i)).type() == Glow.eObjectType_Con) if ( ((GlowArrayElem)cmn.a.get(i)).type() == Glow.eObjectType_Con)
((GlowArrayElem)cmn.a.get(i)).draw(); ((GlowArrayElem)cmn.a.get(i)).draw();
......
...@@ -70,6 +70,7 @@ public class Pwrb { ...@@ -70,6 +70,7 @@ public class Pwrb {
public static final int cClass_ApDistribute = 133232; public static final int cClass_ApDistribute = 133232;
public static final int cClass_AppGraph = 135960; public static final int cClass_AppGraph = 135960;
public static final int cClass_ApplDistribute = 131208; public static final int cClass_ApplDistribute = 131208;
public static final int cClass_AppLink = 136000;
public static final int cClass_ASup = 131216; public static final int cClass_ASup = 131216;
public static final int cClass_Av = 131224; public static final int cClass_Av = 131224;
public static final int cClass_AvArea = 131232; public static final int cClass_AvArea = 131232;
...@@ -318,4 +319,5 @@ public class Pwrb { ...@@ -318,4 +319,5 @@ public class Pwrb {
public static final int cClass_WebGraph = 133472; public static final int cClass_WebGraph = 133472;
public static final int cClass_WebLink = 133480; public static final int cClass_WebLink = 133480;
public static final int cClass_xor = 133136; public static final int cClass_xor = 133136;
public static final int cClass_XttGraph = 133464;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment