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

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

parent 3481feb2
......@@ -3,15 +3,18 @@ package jpwr.app;
import android.graphics.Bitmap;
public class AGraphInfo {
public Bitmap bpm;
public Bitmap bpmInverted;
public String graph;
public String text;
public int iconX;
public int iconY;
public int iconWidth;
public int iconHeight;
public int textX;
public int textY;
public boolean inverted = false;
public static final int TYPE_GRAPH = 0;
public static final int TYPE_LINK = 1;
public int type;
public Bitmap bpm;
public Bitmap bpmInverted;
public String graph;
public String text;
public int iconX;
public int iconY;
public int iconWidth;
public int iconHeight;
public int textX;
public int textY;
public boolean inverted = false;
}
......@@ -12,6 +12,8 @@ public class AXttItemAttrObject extends AXttItemBase {
int flags;
int type;
PwrtAttrRef aref;
int classid;
AXttItemAttrObject(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
......@@ -30,6 +32,8 @@ public class AXttItemAttrObject extends AXttItemBase {
CdhrTypeId cr = axtt.gdh.getAttrRefTid( ar.aref);
if ( cr.evenSts()) return;
classid = cr.typeId;
CdhrObjid coidret = axtt.gdh.classIdToObjid(cr.typeId);
if ( coidret.evenSts()) return;
......@@ -110,4 +114,7 @@ public class AXttItemAttrObject extends AXttItemBase {
public PwrtAttrRef getAttrRef() {
return aref;
}
public int getClassId() {
return classid;
}
}
......@@ -229,4 +229,7 @@ public class AXttItemObject extends AXttItemBase {
}
}
public int getClassId() {
return classid;
}
}
......@@ -116,9 +116,16 @@ public class OpwinCmn implements PlowCmnIfc {
switch (action) {
case PlowCmnIfc.ACTION_UP:
if ( currentGraph != null) {
String cmd = "open graph " + currentGraph.graph;
if ( Math.abs(fx - downX) < 10 && Math.abs(fy - downY) < 10)
appl.command(cmd);
if ( currentGraph.type == AGraphInfo.TYPE_GRAPH) {
String cmd = "open graph " + currentGraph.graph;
if ( Math.abs(fx - downX) < 10 && Math.abs(fy - downY) < 10)
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 = null;
}
......
......@@ -536,6 +536,13 @@ public class GlowDraw implements GlowDrawIfc {
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() {
if ( clipCount == 0) {
System.out.println("Clip mismatch");
......
......@@ -36,7 +36,6 @@
package jpwr.jopg;
import java.awt.*;
import android.graphics.Canvas;
......@@ -63,4 +62,5 @@ public interface GlowDrawIfc {
public int getColor(int gc_type);
public int set_clip_rectangle( int x1, int y1, int x2, int y2);
public void reset_clip_rectangle();
public void set_clip();
}
......@@ -87,6 +87,7 @@ public class GrowFrame implements GraphApplIfc {
public boolean isAuthorized(int access) {
return false;
}
public void openPopupMenu( String object, double x, double y) {}
}
......
This diff is collapsed.
......@@ -70,6 +70,10 @@
android:id="@+id/alarmack_option"
android:title="Alarm Acknowledge"
android:icon="@drawable/xnav_openobject"/>
<item
android:id="@+id/helpclass_option"
android:title="Help Class"
android:icon="@drawable/xnav_openobject"/>
<item
android:id="@+id/changevalue_option"
android:title="Change Value"/>
......
......@@ -50,6 +50,7 @@ public class GrowCtx implements GrowCtxIfc {
double node_move_last_y;
double slider_cursor_offset;
boolean trace_started = false;
boolean drawing = false;
public GrowCtx(GrowApplIfc appl) {
cmn = new GrowCmn( this, appl);
......@@ -366,6 +367,7 @@ public class GrowCtx implements GrowCtxIfc {
}
public void draw() {
drawing = true;
// Draw background color
// draw.fillRect(0, 0, cmn.mw.window_width, cmn.mw.window_height, background_color);
// Draw connections
......@@ -378,10 +380,14 @@ public class GrowCtx implements GrowCtxIfc {
if ( ((GlowArrayElem)cmn.a.get(i)).type() != Glow.eObjectType_Con)
((GlowArrayElem)cmn.a.get(i)).draw();
}
drawing = false;
}
public void draw( double ll_x, double ll_y, double ur_x, double ur_y) {
// TODO
if ( drawing)
return;
for ( int i = 0; i < cmn.a.size(); i++) {
if ( ((GlowArrayElem)cmn.a.get(i)).type() == Glow.eObjectType_Con)
((GlowArrayElem)cmn.a.get(i)).draw();
......
......@@ -70,6 +70,7 @@ public class Pwrb {
public static final int cClass_ApDistribute = 133232;
public static final int cClass_AppGraph = 135960;
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_Av = 131224;
public static final int cClass_AvArea = 131232;
......@@ -318,4 +319,5 @@ public class Pwrb {
public static final int cClass_WebGraph = 133472;
public static final int cClass_WebLink = 133480;
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