BufferReference
interface, and provides a
* means for the persistence layer to retrieve a reference to the backing
@@ -5980,13 +6006,9 @@
public void flush()
throws ValidationException
{
- LegacyTable table = dmoClass.getAnnotation(LegacyTable.class);
- if (table.name().equalsIgnoreCase("_Lock"))
- {
- persistence.flushMetaLockEvents();
- }
- if (checkReadOnlyVstBuffer(table))
- {
+ if (vst)
+ {
+ checkReadOnlyVstBuffer(dmoClass.getAnnotation(LegacyTable.class));
return;
}
@@ -6083,27 +6105,24 @@
* not allow the modified data to be persisted then the flush event should be discarded. Note
* that some VST tables will silently discard the flush event while some of them will also
* display the 14378 error message.
- *
+ *
* @param table
* The {@code LegacyTable} of current DMO class.
- *
- * @return {@code true} if the current DMO belongs to a (VST) table that does not allow the
- * modified data to be persisted.
*/
- private boolean checkReadOnlyVstBuffer(LegacyTable table)
+ private void checkReadOnlyVstBuffer(LegacyTable table)
{
- if (table.category().equalsIgnoreCase("VST"))
- {
- if (table.name().equalsIgnoreCase("_Connect"))
- {
- String msg = "Updating " + table.name() + " Virtual System Table is not supported";
- ErrorManager.recordOrShowError(14378, msg, true);
- }
-
- return table.isFrozen();
- }
-
- return false;
+ String legacyName = table.name();
+
+ if (isTouched)
+ {
+ String msg = "Updating " + legacyName + " Virtual System Table is not supported";
+ ErrorManager.recordOrShowError(14378, msg, true);
+ }
+
+ if (legacyName.equalsIgnoreCase("_Lock"))
+ {
+ persistence.flushMetaLockEvents();
+ }
}
/**
@@ -7040,6 +7059,14 @@
protected void delete()
throws PersistenceException
{
+ if (vst)
+ {
+ // this is quite fatal, NO-ERROR will not prevent it from stopping the procedure
+ ErrorManager.throwError(6311,
+ "Deleting Virtual System Tables is not allowed",
+ null, false);
+ }
+
if (currentRecord == null)
{
// Nothing to delete!
@@ -9057,6 +9084,13 @@
*/
void create()
{
+ if (vst)
+ {
+ // this is quite fatal, NO-ERROR will not prevent it from stopping the procedure
+ ErrorManager.throwError(6248,
+ "Creating records in a Virtual System Table is not allowed", null, false);
+ }
+
initialize();
Long recId = null;
@@ -10851,6 +10885,7 @@
this.undoable.checkUndoable(true);
}
this.currentRecord = newCrtRecord;
+ this.isTouched = false;
// invalidate CURRENT-CHANGED flag. it will be re-set at the end of
// armCurrentChanged/updateCurrentChanged bracketing if the case
@@ -10867,6 +10902,7 @@
}
this.currentRecord = newCrtRecord;
this.recordChanged = false; // invalidate CURRENT-CHANGED flag (see above)
+ this.isTouched = false;
this.newlyCreated = newlyCreated;
this.dirtyCopy = dirtyCopy;
@@ -11861,6 +11897,8 @@
detectChange(null, property, getter, (BaseDataType) args[0], changeCodes);
}
+ isTouched = true;
+
changed = changeCodes[0];
processChange = changeCodes[1] && !batchAssign;
=== added file 'src/com/goldencode/p2j/ui/client/EaseAccessManager.java'
--- src/com/goldencode/p2j/ui/client/EaseAccessManager.java 1970-01-01 00:00:00 +0000
+++ src/com/goldencode/p2j/ui/client/EaseAccessManager.java 2019-01-30 21:06:50 +0000
@@ -0,0 +1,144 @@
+/*
+** Module : EaseAccessManager.java
+** Abstract : Defines the ease access functionality.
+**
+** Copyright (c) 2019, Golden Code Development Corporation.
+**
+** -#- -I- --Date-- ---------------------------------Description---------------------------------
+** 001 SBI 20190129 Defines the ease access functionality.
+*/
+
+/*
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+**
+** Additional terms under GNU Affero GPL version 3 section 7:
+**
+** Under Section 7 of the GNU Affero GPL version 3, the following additional
+** terms apply to the works covered under the License. These additional terms
+** are non-permissive additional terms allowed under Section 7 of the GNU
+** Affero GPL version 3 and may not be removed by you.
+**
+** 0. Attribution Requirement.
+**
+** You must preserve all legal notices or author attributions in the covered
+** work or Appropriate Legal Notices displayed by works containing the covered
+** work. You may not remove from the covered work any author or developer
+** credit already included within the covered work.
+**
+** 1. No License To Use Trademarks.
+**
+** This license does not grant any license or rights to use the trademarks
+** Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+** of Golden Code Development Corporation. You are not authorized to use the
+** name Golden Code, FWD, or the names of any author or contributor, for
+** publicity purposes without written authorization.
+**
+** 2. No Misrepresentation of Affiliation.
+**
+** You may not represent yourself as Golden Code Development Corporation or FWD.
+**
+** You may not represent yourself for publicity purposes as associated with
+** Golden Code Development Corporation, FWD, or any author or contributor to
+** the covered work, without written authorization.
+**
+** 3. No Misrepresentation of Source or Origin.
+**
+** You may not represent the covered work as solely your work. All modified
+** versions of the covered work must be marked in a reasonable way to make it
+** clear that the modified work is not originating from Golden Code Development
+** Corporation or FWD. All modified versions must contain the notices of
+** attribution required in this license.
+*/
+
+package com.goldencode.p2j.ui.client;
+
+import java.util.*;
+
+import com.goldencode.p2j.directory.*;
+import com.goldencode.p2j.security.*;
+
+/**
+ * Defines the ease access functionality.
+ *
+ */
+public class EaseAccessManager
+{
+ /**
+ * The manager instance container.
+ */
+ private static final ContextLocal=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java' --- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java 2018-10-19 22:00:50 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebEmulatedWindow.java 2019-01-29 00:27:55 +0000 @@ -458,6 +458,24 @@ case FILL_RECT_AROUND_TEXT: websock.fillRectAroundText(ps.x, ps.y, ps.width, ps.height, ps.text); break; + case DRAW_STRING_WITHIN_BOX: + websock.drawStringWithinBox(ps.x, + ps.y, + ps.width, + ps.height, + ps.text, + ps.xPoints, + ps.centered); + break; + case DRAW_STRING_WITHIN_BOX_SCALED: + websock.drawStringWithinBoxScaled(ps.x, + ps.y, + ps.width, + ps.height, + ps.text, + ps.xPoints, + ps.centered); + break; case FILL_ROUND_RECT: websock.fillRoundRect(ps.x, ps.y, ps.width, ps.height, ps.arcDiameter); break; === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java' --- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java 2019-01-16 01:08:49 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java 2019-01-29 00:27:55 +0000 @@ -759,13 +759,113 @@ writeMessageInt32(message, 1, x); writeMessageInt32(message, 5, y); - writeMessageInt32(message, 9, textHeightHint); + writeMessageInt32(message, 9, textWidthHint); writeMessageInt32(message, 13, textHeightHint); writeMessageInt32(message, 17, textLength); writeMessageText(message, 21, text); } /** + * Draw a given text within a box given by its relative coordinates. + * + * @param xPosition + * The box horizontal position + * @param yPosition + * The box vertical position + * @param boxWidth + * The box width + * @param boxHeight + * The box height + * @param text + * The given text + * @param indices + * Represents a text segment within the given text that should be drawn; if it isn't + * given, then all given text should be drawn + * @param centered + * Flag indicating if the text needs to be centered vertically. + */ + public void drawStringWithinBox(int xPosition, + int yPosition, + int boxWidth, + int boxHeight, + String text, + int[] indices, + boolean centered) + { + int textLength = text.length(); + int numberIndices = indices != null ? indices.length : 0; + int idx = 2 * textLength + 29; + int msgLengthInBytes = idx + 4 * numberIndices; + + byte[] message = allocateDrawingOp(PaintPrimitives.DRAW_STRING_WITHIN_BOX, msgLengthInBytes); + + writeMessageInt32(message, 1, xPosition); + writeMessageInt32(message, 5, yPosition); + writeMessageInt32(message, 9, boxWidth); + writeMessageInt32(message, 13, boxHeight); + writeMessageInt32(message, 17, centered ? 1 : 0); + writeMessageInt32(message, 21, textLength); + writeMessageInt32(message, 25, numberIndices); + writeMessageText(message, 29, text); + + for (int i = 0; i < numberIndices; i++) + { + writeMessageInt32(message, idx, indices[i]); + idx += 4; + } + } + + /** + * Draw a given text within a box given by its relative coordinates. + * + * @param xPosition + * The box horizontal position + * @param yPosition + * The box vertical position + * @param boxWidth + * The box width + * @param boxHeight + * The box height + * @param text + * The given text + * @param indices + * Represents a text segment within the given text that should be drawn; if it isn't + * given, then all given text should be drawn + * @param centered + * Flag indicating if the text needs to be centered vertically. + */ + public void drawStringWithinBoxScaled(int xPosition, + int yPosition, + int boxWidth, + int boxHeight, + String text, + int[] indices, + boolean centered) + { + int textLength = text.length(); + int numberIndices = indices != null ? indices.length : 0; + int idx = 2 * textLength + 29; + int msgLengthInBytes = idx + 4 * numberIndices; + + byte[] message = allocateDrawingOp(PaintPrimitives.DRAW_STRING_WITHIN_BOX_SCALED, msgLengthInBytes); + + writeMessageInt32(message, 1, xPosition); + writeMessageInt32(message, 5, yPosition); + writeMessageInt32(message, 9, boxWidth); + writeMessageInt32(message, 13, boxHeight); + writeMessageInt32(message, 17, centered ? 1 : 0); + writeMessageInt32(message, 21, textLength); + writeMessageInt32(message, 25, numberIndices); + writeMessageText(message, 29, text); + + for (int i = 0; i < numberIndices; i++) + { + writeMessageInt32(message, idx, indices[i]); + idx += 4; + } + } + + /** * Draw a rounded stroked rectangle in the current color/stroke. * * @param x === modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js' --- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2018-11-22 22:51:34 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2019-01-29 10:29:11 +0000 @@ -94,6 +94,7 @@ ** trips to the Java side until operation completes. Fixed the bug in cancelDrag ** implementation. We need to clean dragTimeout when it is not null, meaning ** there is pending code waiting to be called we need to cancel. +** 039 SBI 20190129 Added DRAW_STRING_WITHIN_BOX and DRAW_STRING_WITHIN_BOX_SCALED primitives. */ /* @@ -235,7 +236,9 @@ DRAW_ELLIPSE : 46, FILL_ELLIPSE : 47, DRAW_IBEAM : 48, - START_DIRECT_MANIPULATION : 49 + START_DIRECT_MANIPULATION : 49, + DRAW_STRING_WITHIN_BOX : 50, + DRAW_STRING_WITHIN_BOX_SCALED : 51 }; /* map cursor id to name */ @@ -2031,6 +2034,79 @@ "; centered = " + centered + "; lwidth = " + lwidth + "; lheight = " + lheight; break; + case ops.DRAW_STRING_WITHIN_BOX: + case ops.DRAW_STRING_WITHIN_BOX_SCALED: + offset = 1; + + var xPosition = p2j.socket.readInt32BinaryMessage(message, idx + 1); + + var yPosition = p2j.socket.readInt32BinaryMessage(message, idx + 5); + + width = p2j.socket.readInt32BinaryMessage(message, idx + 9); + + height = p2j.socket.readInt32BinaryMessage(message, idx + 13); + + centered = (p2j.socket.readInt32BinaryMessage(message, idx + 17) == 1); + + textLength = p2j.socket.readInt32BinaryMessage(message, idx + 21); + + var numberIndices = p2j.socket.readInt32BinaryMessage(message, idx + 25); + + text = p2j.socket.readStringBinaryMessageByLength(message, idx + 29, textLength); + + offset = 29 + 2 * textLength; + + var indices = []; + + for (var j = 0; j < numberIndices; j++) + { + indices[j] = p2j.socket.readInt32BinaryMessage(message, idx + offset); + offset += 4; + } + + if (numberIndices == 0) + { + indices[0] = 0; + indices[1] = textLength; + numberIndices = 2; + } + var nativeWidth = p2j.fonts.getTextWidth(currentFont, text); + + x = xPosition + (width - nativeWidth)/2; + y = yPosition; + for (var k = 0; k < numberIndices / 2; k++) + { + var delta; + + if (indices[k] != 0) + { + delta = p2j.fonts.getTextWidth(currentFont, text.substring(0, indices[k])); + } + else + { + delta = 0; + } + if (type == ops.DRAW_STRING_WITHIN_BOX) + { + this.canvasRenderer.drawText(text.substring(indices[k], indices[k+1]), + x + delta, + y, + centered); + } + else + { + this.canvasRenderer.drawScaledText(currentFont, + text.substring(indices[k], indices[k+1]), + x + delta, + y, + centered, + width, + height); + } + + } + + break; case ops.DRAW_PARAGRAPH: offset = 1; === modified file 'src/com/goldencode/p2j/ui/client/gui/theme/ClassicTheme.java' --- src/com/goldencode/p2j/ui/client/gui/theme/ClassicTheme.java 2019-01-10 03:36:22 +0000 +++ src/com/goldencode/p2j/ui/client/gui/theme/ClassicTheme.java 2019-01-29 10:29:11 +0000 @@ -47,6 +47,7 @@ ** 028 HC 20181124 Implemented TREEVIEW widget and related changes. ** 029 HC 20181228 Various draw fixes - connected dots, node icon of the expanded node. ** 030 EVL 20190109 Adding fix for label clipping in some conditions. +** 031 SBI 20190129 Changed drawButtonInternal to calculate label's offsets on GUI driver side. */ /* @@ -1263,9 +1264,10 @@ gd.setGuiFont(fnt); int fontNum = gf.resolveFontNum(); int fontHeight = FontManager.getFontHeight(WindowManager.resolveWindow(button), fontNum, gd); - int xt = orig.x + (dim.width - button.getTextWidthNative(label, fontNum)) / 2; + // do not simplify the line below, this makes the font height to be up nearest even number int yt = orig.y + (dim.height + fontHeight + 1)/2 - 3; + gd.setFontStyle(fnt.style); // enabled state controls text drawing if (button.isEnabled()) @@ -1273,27 +1275,34 @@ gd.setColor(gc.fgColor); if (pressed) { - gd.drawString(label, xt + 1, yt + 1); + gd.drawStringWithinBox(orig.x + 1, yt + 1, dim.width, dim.height, label, null, false); } else { if (labelInfo != null && labelInfo.getMnemIdx() != null) { - NativePoint tp = new NativePoint(xt, yt); - gd.drawStringWithMnemonic(label, tp, labelInfo, gf, button, false); + gd.drawStringWithinBoxWithMnemonic(label, + orig.x, + yt, + dim.width, + dim.height, + labelInfo, + gf, + button, + false); } else { - gd.drawString(label, xt, yt); + gd.drawStringWithinBox(orig.x, yt, dim.width, dim.height, label, null, false); } } } else { gd.setColor(lightShadow); - gd.drawString(label, xt + 1, yt + 1); + gd.drawStringWithinBox(orig.x + 1, yt + 1, dim.width, dim.height, label, null, false); gd.setColor(darkShadow); - gd.drawString(label, xt, yt); + gd.drawStringWithinBox(orig.x, yt, dim.width, dim.height, label, null, false); } // draw dotted rectangle around focused button text === modified file 'src/com/goldencode/p2j/ui/client/gui/theme/MaterialTheme.java' --- src/com/goldencode/p2j/ui/client/gui/theme/MaterialTheme.java 2018-10-04 17:04:18 +0000 +++ src/com/goldencode/p2j/ui/client/gui/theme/MaterialTheme.java 2019-01-29 10:29:11 +0000 @@ -9,7 +9,8 @@ ** 002 OM 20180905 Added configuration support from the web page. ** SVL 20180930 Row and column separators can be drawn independently. ** 003 OM 20181004 Minor fixes. - */ + ** 004 SBI 20190129 Changed drawButton to calculate label's offsets on GUI driver side. +*/ /* ** This program is free software: you can redistribute it and/or modify @@ -426,7 +427,7 @@ // do not simplify the line below, this makes the font height to be up nearest even number int tY = y + (height - 1) / 2; - int tX = x + (width - button.getTextWidthNative(label, fontNum)) / 2; + gd.setFontStyle(fnt.style); Color fillBackground = null; // by default background is not filled @@ -529,13 +530,20 @@ if (labelInfo != null && labelInfo.getMnemIdx() != null) { - NativePoint tp = new NativePoint(tX, tY); - gd.drawStringWithMnemonic(label, tp, labelInfo, gf, button, true); + gd.drawStringWithinBoxWithMnemonic(label, + x, + tY, + width, + height, + labelInfo, + gf, + button, + true); } else { // no mnemonic available - gd.drawStringCentered(label, tX, tY); + gd.drawStringWithinBox(x, tY, width, height, label, null, true); } } } === modified file 'src/com/goldencode/p2j/ui/client/gui/theme/Windows10Theme.java' --- src/com/goldencode/p2j/ui/client/gui/theme/Windows10Theme.java 2018-09-30 12:31:23 +0000 +++ src/com/goldencode/p2j/ui/client/gui/theme/Windows10Theme.java 2019-01-29 10:29:11 +0000 @@ -33,6 +33,7 @@ ** 020 EVL 20180822 Fix for regression caused by previous button feedback fix. ** SVL 20180901 Support for enhanced sorting. Row and column separators can be drawn ** independently. +** 021 SBI 20190129 Changed drawButton to calculate label's offsets on GUI driver side. */ /* @@ -1022,13 +1023,18 @@ // draw button text FontDetails fnt = gf.font().font; + gd.setGuiFont(fnt); + int fontNum = gf.resolveFontNum(); + MnemonicInfo labelInfo = button.getMnemonic(); + String label = (labelInfo == null) ? button.textLabel() : labelInfo.getPrepLabel(); + // do not simplify the line below, this makes the font height to be up nearest even number int tY = y + (height - 1) / 2; - int tX = x + (width - button.getTextWidthNative(label, fontNum)) / 2; + gd.setFontStyle(fnt.style); if (!button.isEnabled()) // disabled button @@ -1130,13 +1136,20 @@ } if (labelInfo != null && labelInfo.getMnemIdx() != null) { - NativePoint tp = new NativePoint(tX, tY); - gd.drawStringWithMnemonic(label, tp, labelInfo, gf, button, true); + gd.drawStringWithinBoxWithMnemonic(label, + x, + tY, + width, + height, + labelInfo, + gf, + button, + true); } else { // no mnemonic available - gd.drawStringCentered(label, tX, tY); + gd.drawStringWithinBox(x, tY, width, height, label, null, true); } } === modified file 'src/com/goldencode/p2j/ui/client/gui/theme/Windows8Theme.java' --- src/com/goldencode/p2j/ui/client/gui/theme/Windows8Theme.java 2018-11-15 20:57:53 +0000 +++ src/com/goldencode/p2j/ui/client/gui/theme/Windows8Theme.java 2019-01-29 10:29:11 +0000 @@ -20,6 +20,7 @@ ** when the mouse is not over widget. ** 013 EVL 20180822 Fix for regression caused by previous button feedback fix. ** 014 EVL 20181113 Small change for regular button border color and some related changes. +** 015 SBI 20190129 Changed drawButton to calculate label's offsets on GUI driver side. */ /* @@ -867,7 +868,7 @@ // do not simplify the line below, this makes the font height to be up nearest even number int tY = y + (height - 1) / 2; - int tX = x + (width - button.getTextWidthNative(label, fontNum)) / 2; + gd.setFontStyle(fnt.style); if (!button.isEnabled()) // disabled button @@ -962,15 +963,15 @@ { gd.setColor(new Color(0x848284)); // disabled text, not in palette ? } + if (labelInfo != null && labelInfo.getMnemIdx() != null) { - NativePoint tp = new NativePoint(tX, tY); - gd.drawStringWithMnemonic(label, tp, labelInfo, gf, button, true); + gd.drawStringWithinBoxWithMnemonic(label, x, tY, width, height, labelInfo, gf, button, true); } else { // no mnemonic available - gd.drawStringCentered(label, tX, tY); + gd.drawStringWithinBox(x, tY, width, height, label, null, true); } } === modified file 'src/com/goldencode/p2j/util/SharedVariableManager.java' --- src/com/goldencode/p2j/util/SharedVariableManager.java 2018-01-02 19:25:57 +0000 +++ src/com/goldencode/p2j/util/SharedVariableManager.java 2019-01-28 18:54:56 +0000 @@ -2,7 +2,7 @@ ** Module : SharedVariableManager.java ** Abstract : provides context-local scoped resource pools. ** -** Copyright (c) 2004-2018, Golden Code Development Corporation. +** Copyright (c) 2004-2019, Golden Code Development Corporation. ** ** -#- -I- --Date-- --JPRM-- ----------------------------Description---------------------------- ** 001 GES 20050729 @21924 Provides context-local scoped variable and stream pools. @@ -76,6 +76,9 @@ ** this-procedure and if not found, go back in the stack and look in ** each procedure's state. ** 027 GES 20180102 Changed a comment. +** 028 EVL 20190128 Changed the approach to keep NO-UNDO option and check the variable +** against it. Now all variables are storing in no-undo map with true +** or false value for option. */ /* @@ -515,11 +518,8 @@ addWorker(sr, scope, name, var); - if (noUndo) - { - // save this variable as NO-UNDO - addWorker(vr.noUndoVars, scope, name, var); - } + // the no-undo map now keeps the option value for every variable + addWorker(vr.noUndoVars, scope, name, noUndo); if (extent) { @@ -1838,7 +1838,8 @@ SharedRegistry noUndoWa = v.noUndoVars; Object sharedNoUndoVar = noUndoWa.shared.lookupSymbol(name); - boolean sharedNoUndo = (sharedNoUndoVar != null); + boolean sharedNoUndo = (sharedNoUndoVar != null && + ((Boolean)sharedNoUndoVar).booleanValue()); if (sharedNoUndo != noUndo) {