0001: // @@
0002: // @@
0003: /*
0004: * Wi.Ser Framework
0005: *
0006: * Version: 1.8.1, 20-September-2007
0007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
0008: *
0009: * This library is free software; you can redistribute it and/or
0010: * modify it under the terms of the GNU Lesser General Public
0011: * License as published by the Free Software Foundation; either
0012: * version 2 of the License, or (at your option) any later version.
0013: *
0014: * This library is distributed in the hope that it will be useful,
0015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0017: * Lesser General Public License for more details.
0018: *
0019: * You should have received a copy of the GNU Lesser General Public
0020: * License along with this library located in LGPL.txt in the
0021: * license directory; if not, write to the
0022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0023: * Boston, MA 02111-1307, USA.
0024: *
0025: * If this agreement does not cover your requirements, please contact us
0026: * via email to get detailed information about the commercial license
0027: * or our service offerings!
0028: *
0029: */
0030: // @@
0031: package de.ug2t.channel.markup.generic;
0032:
0033: import java.awt.*;
0034: import java.util.*;
0035:
0036: import de.ug2t.channel.markup.html.renderer.*;
0037: import de.ug2t.connector.*;
0038: import de.ug2t.kernel.*;
0039: import de.ug2t.unifiedGui.*;
0040: import de.ug2t.unifiedGui.interfaces.*;
0041:
0042: public final class MuGenericDialog extends MuGenericContainer implements
0043: IUnDialog, IKePoolable, IUnGuiEventListener {
0044: protected boolean pdm_isDisplay = false;
0045: protected IUnLink pdm_submitClose = null;
0046: protected IUnLink pdm_submitLock = null;
0047: protected IUnLink pdm_submitFront = null;
0048: protected IUnLink pdm_submitMiMa = null;
0049: protected IUnButton pdm_submitWP = null;
0050: protected IUnButton pdm_submitWM = null;
0051: protected IUnButton pdm_submitHP = null;
0052: protected IUnButton pdm_submitHM = null;
0053: protected MuGenericDialogPosition pdm_posMark = null;
0054: protected MuGenericDialogSize pdm_sizeMark = null;
0055: protected boolean pdm_deco = true;
0056: protected boolean pdm_isResizable = true;
0057: protected boolean pdm_scroll = true;
0058: protected IUnImage pdm_bgImg = null;
0059:
0060: private IUnImage pem_wClose = null;
0061: private IUnImage pem_wMin = null;
0062: private IUnImage pem_wMax = null;
0063: private IUnImage pem_wLock = null;
0064: private IUnImage pem_wTop = null;
0065: private boolean pem_submitReshapes = false;
0066:
0067: protected boolean pdm_modal = false;
0068: protected ArrayList pdm_modalChanges = new ArrayList();
0069: protected ArrayList pdm_modalChangesDlg = new ArrayList();
0070:
0071: protected boolean pdm_showSizeButs = false;
0072: protected boolean pdm_showWCtrlButs = true;
0073: protected boolean pdm_useIcons = true;
0074:
0075: private boolean pem_mini = false;
0076:
0077: public final class MuGenericDialogPosition extends UnComponent {
0078: private MuGenericComponent pem_myWidget = null;
0079: private int pem_x = -1;
0080: private int pem_y = -1;
0081:
0082: /**
0083: * @param xName
0084: * @throws Exception
0085: */
0086: public MuGenericDialogPosition(String xName,
0087: MuGenericComponent xMyWidget) throws Exception {
0088: super (xName);
0089: this .pem_myWidget = xMyWidget;
0090:
0091: return;
0092: }
0093:
0094: public int pcmf_getX() {
0095: Object l_value = this .pcmf_getValue();
0096: if (l_value == null || l_value.equals(""))
0097: l_value = Integer.toString(this .pem_myWidget
0098: .pcmf_getXPos())
0099: + "px"
0100: + ","
0101: + Integer.toString(this .pem_myWidget
0102: .pcmf_getYPos()) + "px";
0103:
0104: l_value = l_value.toString().substring(0,
0105: l_value.toString().indexOf("p"));
0106:
0107: KeLog.pcmf_log("ug2t", "setting dialog xPosition to: "
0108: + l_value.toString(), this , KeLog.DEBUG);
0109:
0110: return (Integer.parseInt(l_value.toString()));
0111: }
0112:
0113: public int pcmf_getY() {
0114: Object l_value = this .pcmf_getValue();
0115: if (l_value == null || l_value.equals(""))
0116: l_value = Integer.toString(this .pem_myWidget
0117: .pcmf_getXPos())
0118: + "px"
0119: + ","
0120: + Integer.toString(this .pem_myWidget
0121: .pcmf_getYPos()) + "px";
0122:
0123: l_value = l_value.toString().substring(
0124: l_value.toString().indexOf(",") + 1,
0125: l_value.toString().length() - 2);
0126:
0127: KeLog.pcmf_log("ug2t", "setting dialog yPosition to: "
0128: + l_value.toString(), this , KeLog.DEBUG);
0129:
0130: return (Integer.parseInt(l_value.toString()));
0131: }
0132:
0133: public void pcmf_setValue(Object xObj) {
0134: super .pcmf_setValue(xObj);
0135: if (this .pcmf_getPropChanged()) {
0136: this .pem_myWidget.pcmf_setPropChanged(true);
0137: if (((MuGenericDialog) this .pem_myWidget)
0138: .pcmf_getGenerateReshapeEvents()) {
0139: if (this .pem_x != this .pcmf_getX()
0140: || this .pem_y != this .pcmf_getY()) {
0141: ((MuGenericDialog) this .pem_myWidget)
0142: .pcmf_setValue(IUnDialog.DIALOG_MOVED
0143: + ":" + pcmf_getX() + "px,"
0144: + pcmf_getY() + "px");
0145: try {
0146: this .pem_myWidget.pcmf_dispatchEvent();
0147: } catch (Exception e) {
0148: KeLog.pcmf_logException("ug2t", this , e);
0149: }
0150: }
0151: }
0152: this .pem_x = this .pcmf_getX();
0153: this .pem_y = this .pcmf_getY();
0154: }
0155: }
0156: }
0157:
0158: public final class MuGenericDialogSize extends UnComponent {
0159: private MuGenericComponent pem_myWidget = null;
0160: private int pem_hi = -1;
0161: private int pem_wi = -1;
0162:
0163: /**
0164: * @param xName
0165: * @throws Exception
0166: */
0167: public MuGenericDialogSize(String xName,
0168: MuGenericComponent xMyWidget) throws Exception {
0169: super (xName);
0170: this .pem_myWidget = xMyWidget;
0171:
0172: return;
0173: }
0174:
0175: public int pcmf_getWi() {
0176: Object l_value = this .pcmf_getValue();
0177: if (l_value == null || l_value.equals(""))
0178: l_value = Integer.toString(this .pem_myWidget
0179: .pcmf_getWi())
0180: + "px"
0181: + ","
0182: + Integer.toString(this .pem_myWidget
0183: .pcmf_getHi()) + "px";
0184:
0185: l_value = l_value.toString().substring(0,
0186: l_value.toString().indexOf("p"));
0187:
0188: KeLog.pcmf_log("ug2t", "setting dialog width to: "
0189: + l_value.toString(), this , KeLog.DEBUG);
0190:
0191: return (Integer.parseInt(l_value.toString()));
0192: }
0193:
0194: public int pcmf_getHi() {
0195: Object l_value = this .pcmf_getValue();
0196: if (l_value == null || l_value.equals(""))
0197: l_value = Integer.toString(this .pem_myWidget
0198: .pcmf_getWi())
0199: + "px"
0200: + ","
0201: + Integer.toString(this .pem_myWidget
0202: .pcmf_getHi()) + "px";
0203:
0204: l_value = l_value.toString().substring(
0205: l_value.toString().indexOf(",") + 1,
0206: l_value.toString().length() - 2);
0207:
0208: KeLog.pcmf_log("ug2t", "setting dialog height to: "
0209: + l_value.toString(), this , KeLog.DEBUG);
0210:
0211: return (Integer.parseInt(l_value.toString()));
0212: }
0213:
0214: public void pcmf_setValue(Object xObj) {
0215: super .pcmf_setValue(xObj);
0216: if (this .pcmf_getPropChanged()) {
0217: this .pem_myWidget.pcmf_setPropChanged(true);
0218: if (((MuGenericDialog) this .pem_myWidget)
0219: .pcmf_getGenerateReshapeEvents()) {
0220: if (this .pem_hi != this .pcmf_getHi()
0221: || this .pem_wi != this .pcmf_getWi()) {
0222: ((MuGenericDialog) this .pem_myWidget)
0223: .pcmf_setValue(IUnDialog.DIALOG_RESIZED
0224: + ":" + pcmf_getWi() + "px,"
0225: + pcmf_getHi() + "px");
0226: try {
0227: this .pem_myWidget.pcmf_dispatchEvent();
0228: } catch (Exception e) {
0229: KeLog.pcmf_logException("ug2t", this , e);
0230: }
0231: }
0232: }
0233: this .pem_hi = this .pcmf_getHi();
0234: this .pem_wi = this .pcmf_getWi();
0235: }
0236: }
0237: }
0238:
0239: final class MuGenericDialogListener implements IUnGuiEventListener {
0240: private IUnDialog pem_myWidget = null;
0241:
0242: public MuGenericDialogListener(IUnDialog xMyWidget) {
0243: this .pem_myWidget = xMyWidget;
0244:
0245: return;
0246: }
0247:
0248: public void pcmf_execListener(UnComponent xParam) {
0249: this .pem_myWidget.pcmf_hideDialog();
0250: return;
0251: };
0252: };
0253:
0254: final class MuGenericDialogThListener implements
0255: IUnGuiEventListener {
0256: private MuGenericDialog pem_myWidget = null;
0257: private int pem_ow = 0;
0258: private int pem_oh = 0;
0259:
0260: public MuGenericDialogThListener(MuGenericDialog xMyWidget) {
0261: this .pem_myWidget = xMyWidget;
0262:
0263: return;
0264: }
0265:
0266: public void pcmf_execListener(UnComponent xParam) {
0267: this .pem_myWidget.pem_mini = !this .pem_myWidget.pem_mini;
0268: if (this .pem_myWidget.pem_mini) {
0269: pem_ow = this .pem_myWidget.pcmf_getWi();
0270: pem_oh = this .pem_myWidget.pcmf_getHi();
0271: this .pem_myWidget
0272: .pcmf_setPosition(this .pem_myWidget.pdm_posMark
0273: .pcmf_getX(),
0274: this .pem_myWidget.pdm_posMark
0275: .pcmf_getY(),
0276: this .pem_myWidget.pcmf_getName()
0277: .length() * 12 + 25, 25, null);
0278:
0279: if (this .pem_myWidget.pdm_useIcons)
0280: this .pem_myWidget.pdm_submitMiMa
0281: .pcmf_setIcon(this .pem_myWidget.pem_wMax);
0282: else
0283: this .pem_myWidget.pdm_submitMiMa.pcmf_setValue("+");
0284:
0285: this .pem_myWidget.pcmf_hideAllChildren();
0286: } else {
0287: this .pem_myWidget.pcmf_setPosition(
0288: this .pem_myWidget.pdm_posMark.pcmf_getX(),
0289: this .pem_myWidget.pdm_posMark.pcmf_getY(),
0290: this .pem_ow, this .pem_oh, null);
0291: this .pem_myWidget.pdm_submitMiMa
0292: .pcmf_setIcon(this .pem_myWidget.pem_wMin);
0293: this .pem_myWidget.pcmf_unHideAllChildren();
0294: }
0295:
0296: try {
0297: this .pem_myWidget
0298: .pcmf_getUnComponent()
0299: .pcmf_setValue(
0300: this .pem_myWidget.pem_mini ? IUnDialog.DIALOG_ICONIFIED
0301: : IUnDialog.DIALOG_DEICONIFIED);
0302: this .pem_myWidget.pcmf_getUnComponent()
0303: .pcmf_dispatchEvent();
0304: } catch (Exception e) {
0305: KeLog.pcmf_logException("ug2t", this , e);
0306: }
0307: return;
0308: };
0309: };
0310:
0311: final class MuGenericDialogRsListener implements
0312: IUnGuiEventListener {
0313: private MuGenericDialog pem_myWidget = null;
0314:
0315: public MuGenericDialogRsListener(MuGenericDialog xMyWidget) {
0316: this .pem_myWidget = xMyWidget;
0317:
0318: return;
0319: }
0320:
0321: public void pcmf_execListener(UnComponent xParam) {
0322: if (xParam.pcmf_getValue().equals("w"))
0323: this .pem_myWidget.pcmf_setPosition(
0324: this .pem_myWidget.pdm_posMark.pcmf_getX(),
0325: this .pem_myWidget.pdm_posMark.pcmf_getY(),
0326: this .pem_myWidget.pcmf_getWi() + 50,
0327: this .pem_myWidget.pcmf_getHi(), null);
0328: else if (xParam.pcmf_getValue().equals("n"))
0329: this .pem_myWidget
0330: .pcmf_setPosition(
0331: this .pem_myWidget.pdm_posMark
0332: .pcmf_getX(),
0333: this .pem_myWidget.pdm_posMark
0334: .pcmf_getY(),
0335: this .pem_myWidget.pcmf_getWi() - 50 > this .pem_myWidget
0336: .pcmf_getName().length() * 12 + 150 ? this .pem_myWidget
0337: .pcmf_getWi() - 50
0338: : this .pem_myWidget
0339: .pcmf_getWi(),
0340: this .pem_myWidget.pcmf_getHi(), null);
0341: else if (xParam.pcmf_getValue().equals("t"))
0342: this .pem_myWidget.pcmf_setPosition(
0343: this .pem_myWidget.pdm_posMark.pcmf_getX(),
0344: this .pem_myWidget.pdm_posMark.pcmf_getY(),
0345: this .pem_myWidget.pcmf_getWi(),
0346: this .pem_myWidget.pcmf_getHi() + 50, null);
0347: else if (xParam.pcmf_getValue().equals("f"))
0348: this .pem_myWidget
0349: .pcmf_setPosition(
0350: this .pem_myWidget.pdm_posMark
0351: .pcmf_getX(),
0352: this .pem_myWidget.pdm_posMark
0353: .pcmf_getY(),
0354: this .pem_myWidget.pcmf_getWi(),
0355: this .pem_myWidget.pcmf_getHi() > 75 ? this .pem_myWidget
0356: .pcmf_getHi() - 50
0357: : this .pem_myWidget
0358: .pcmf_getHi(), null);
0359:
0360: return;
0361: };
0362: };
0363:
0364: final class MuGenericDialogToFrontListener implements
0365: IUnGuiEventListener {
0366: private IUnDialog pem_myWidget = null;
0367:
0368: public MuGenericDialogToFrontListener(IUnDialog xMyWidget) {
0369: this .pem_myWidget = xMyWidget;
0370:
0371: return;
0372: }
0373:
0374: public void pcmf_execListener(UnComponent xParam) {
0375: this .pem_myWidget.pcmf_toFront();
0376:
0377: return;
0378: };
0379: };
0380:
0381: /**
0382: * @param xName
0383: * @param xTplGetter
0384: * @param xTplName
0385: * @param xAppl
0386: * @throws Exception
0387: */
0388: public MuGenericDialog(String xName, ACoDataGetter xTplGetter,
0389: Object xTplName, MuGenericApplication xAppl)
0390: throws Exception {
0391: super (xName, xTplGetter, xTplName, xAppl);
0392:
0393: this .pdm_NodeView = new HtmlDialogRenderer();
0394:
0395: try {
0396: this .pem_wClose = this .pcmf_getAppl()
0397: .pcmf_getComponentFactory().pcmf_createImage(
0398: UnComponentFactory.MARKUP,
0399: "wclose",
0400: this .pcmf_getMarkupString("WCLOSE")
0401: .toString(), this .pcmf_getAppl());
0402: this .pem_wMin = this .pcmf_getAppl()
0403: .pcmf_getComponentFactory().pcmf_createImage(
0404: UnComponentFactory.MARKUP,
0405: "wmin",
0406: this .pcmf_getMarkupString("WMIN")
0407: .toString(), this .pcmf_getAppl());
0408: this .pem_wMax = this .pcmf_getAppl()
0409: .pcmf_getComponentFactory().pcmf_createImage(
0410: UnComponentFactory.MARKUP,
0411: "wmax",
0412: this .pcmf_getMarkupString("WMAX")
0413: .toString(), this .pcmf_getAppl());
0414: this .pem_wLock = this .pcmf_getAppl()
0415: .pcmf_getComponentFactory().pcmf_createImage(
0416: UnComponentFactory.MARKUP,
0417: "wlock",
0418: this .pcmf_getMarkupString("WLOCK")
0419: .toString(), this .pcmf_getAppl());
0420: this .pem_wTop = this .pcmf_getAppl()
0421: .pcmf_getComponentFactory().pcmf_createImage(
0422: UnComponentFactory.MARKUP,
0423: "wtop",
0424: this .pcmf_getMarkupString("WTOP")
0425: .toString(), this .pcmf_getAppl());
0426: } catch (Exception e) {
0427: KeLog.pcmf_log("ug2t",
0428: "icons for mdi page decorator not found", this ,
0429: KeLog.ERROR);
0430: this .pdm_useIcons = false;
0431: }
0432:
0433: if (this .pdm_useIcons) {
0434: this .pdm_submitClose = this .pcmf_getAppl()
0435: .pcmf_getComponentFactory().pcmf_createLink(
0436: UnComponentFactory.MARKUP, "",
0437: this .pcmf_getAppl());
0438: this .pdm_submitClose.pcmf_setIcon(this .pem_wClose);
0439: } else
0440: this .pdm_submitClose = this .pcmf_getAppl()
0441: .pcmf_getComponentFactory().pcmf_createLink(
0442: UnComponentFactory.MARKUP, "X",
0443: this .pcmf_getAppl());
0444:
0445: this .pdm_submitClose.pcmf_setFont(new UnFontDescriptor("arial",
0446: 10, Font.PLAIN));
0447: this .pdm_submitClose.pcmf_setToolTip(this .pcmf_getMarkupString(
0448: "CLOSE_WIN").toString());
0449:
0450: if (this .pdm_useIcons) {
0451: this .pdm_submitLock = this .pcmf_getAppl()
0452: .pcmf_getComponentFactory().pcmf_createLink(
0453: UnComponentFactory.MARKUP, "",
0454: this .pcmf_getAppl());
0455: this .pdm_submitLock.pcmf_setIcon(this .pem_wLock);
0456: } else
0457: this .pdm_submitLock = this .pcmf_getAppl()
0458: .pcmf_getComponentFactory().pcmf_createLink(
0459: UnComponentFactory.MARKUP, "*",
0460: this .pcmf_getAppl());
0461:
0462: this .pdm_submitLock.pcmf_setFont(new UnFontDescriptor("arial",
0463: 10, Font.PLAIN));
0464: this .pdm_submitLock.pcmf_setToolTip(this .pcmf_getMarkupString(
0465: "LOCK_WIN").toString());
0466:
0467: if (this .pdm_useIcons) {
0468: this .pdm_submitFront = this .pcmf_getAppl()
0469: .pcmf_getComponentFactory().pcmf_createLink(
0470: UnComponentFactory.MARKUP, "",
0471: this .pcmf_getAppl());
0472: this .pdm_submitFront.pcmf_setIcon(this .pem_wTop);
0473: } else
0474: this .pdm_submitFront = this .pcmf_getAppl()
0475: .pcmf_getComponentFactory().pcmf_createLink(
0476: UnComponentFactory.MARKUP, "^",
0477: this .pcmf_getAppl());
0478:
0479: this .pdm_submitFront.pcmf_setFont(new UnFontDescriptor("arial",
0480: 10, Font.PLAIN));
0481: this .pdm_submitFront.pcmf_setToolTip(this .pcmf_getMarkupString(
0482: "FRONT_WIN").toString());
0483:
0484: if (this .pdm_useIcons) {
0485: this .pdm_submitMiMa = this .pcmf_getAppl()
0486: .pcmf_getComponentFactory().pcmf_createLink(
0487: UnComponentFactory.MARKUP, "",
0488: this .pcmf_getAppl());
0489: this .pdm_submitMiMa.pcmf_setIcon(this .pem_wMin);
0490: } else
0491: this .pdm_submitMiMa = this .pcmf_getAppl()
0492: .pcmf_getComponentFactory().pcmf_createLink(
0493: UnComponentFactory.MARKUP, "_",
0494: this .pcmf_getAppl());
0495:
0496: this .pdm_submitMiMa.pcmf_setFont(new UnFontDescriptor("arial",
0497: 10, Font.PLAIN));
0498: this .pdm_submitMiMa.pcmf_setToolTip(this .pcmf_getMarkupString(
0499: "MIMA_WIN").toString());
0500:
0501: this .pdm_submitWP = this .pcmf_getAppl()
0502: .pcmf_getComponentFactory().pcmf_createButton(
0503: UnComponentFactory.MARKUP, "w",
0504: this .pcmf_getAppl());
0505: this .pdm_submitWP.pcmf_setFont(new UnFontDescriptor("arial",
0506: 10, Font.PLAIN));
0507: this .pdm_submitWP.pcmf_setToolTip(this .pcmf_getMarkupString(
0508: "INC_W").toString());
0509:
0510: this .pdm_submitWM = this .pcmf_getAppl()
0511: .pcmf_getComponentFactory().pcmf_createButton(
0512: UnComponentFactory.MARKUP, "n",
0513: this .pcmf_getAppl());
0514: this .pdm_submitWM.pcmf_setFont(new UnFontDescriptor("arial",
0515: 10, Font.PLAIN));
0516: this .pdm_submitWM.pcmf_setToolTip(this .pcmf_getMarkupString(
0517: "DEC_W").toString());
0518:
0519: this .pdm_submitHP = this .pcmf_getAppl()
0520: .pcmf_getComponentFactory().pcmf_createButton(
0521: UnComponentFactory.MARKUP, "t",
0522: this .pcmf_getAppl());
0523: this .pdm_submitHP.pcmf_setFont(new UnFontDescriptor("arial",
0524: 10, Font.PLAIN));
0525: this .pdm_submitHP.pcmf_setToolTip(this .pcmf_getMarkupString(
0526: "INC_H").toString());
0527:
0528: this .pdm_submitHM = this .pcmf_getAppl()
0529: .pcmf_getComponentFactory().pcmf_createButton(
0530: UnComponentFactory.MARKUP, "f",
0531: this .pcmf_getAppl());
0532: this .pdm_submitHM.pcmf_setFont(new UnFontDescriptor("arial",
0533: 10, Font.PLAIN));
0534: this .pdm_submitHM.pcmf_setToolTip(this .pcmf_getMarkupString(
0535: "DEC_H").toString());
0536:
0537: IUnGuiEventListener l_rsList = new MuGenericDialogRsListener(
0538: this );
0539: this .pdm_submitWP.pcmf_getUnComponent().pcmf_addListener(
0540: l_rsList);
0541: this .pdm_submitWM.pcmf_getUnComponent().pcmf_addListener(
0542: l_rsList);
0543: this .pdm_submitHP.pcmf_getUnComponent().pcmf_addListener(
0544: l_rsList);
0545: this .pdm_submitHM.pcmf_getUnComponent().pcmf_addListener(
0546: l_rsList);
0547:
0548: this .pdm_posMark = new MuGenericDialogPosition(this
0549: .pcmf_getObjName(), this );
0550: this .pdm_sizeMark = new MuGenericDialogSize(this
0551: .pcmf_getObjName(), this );
0552:
0553: this .pdm_submitClose.pcmf_getUnComponent().pcmf_addListener(
0554: new MuGenericDialogListener(this ));
0555: this .pdm_submitFront.pcmf_getUnComponent().pcmf_addListener(
0556: new MuGenericDialogToFrontListener(this ));
0557: this .pdm_submitMiMa.pcmf_getUnComponent().pcmf_addListener(
0558: new MuGenericDialogThListener(this ));
0559:
0560: this .pcmf_setPosition(100, 100, 500, 400, null);
0561:
0562: this .pcmf_setBgColor(this .pdm_kit.getDEF_DBOR());
0563: this .pcmf_setFgColor("white");
0564: this .pcmf_setFill(true, true);
0565:
0566: // Debug
0567: // this.pcmf_setGenerateReshapeEvents(true);
0568: // this.pcmf_addListener(new UnPrintValueListener());
0569:
0570: return;
0571: }
0572:
0573: // @@
0574:
0575: public MuGenericDialogPosition pcmf_getPosMark() {
0576: return (this .pdm_posMark);
0577: }
0578:
0579: public MuGenericDialogSize pcmf_getSizeMark() {
0580: return (this .pdm_sizeMark);
0581: }
0582:
0583: public void pcmf_displayDialog() {
0584: if (this .pdm_isDisplay)
0585: return;
0586:
0587: this .pdm_isDisplay = true;
0588: this .pcmf_toFront();
0589: ((MuGenericApplication) this .pcmf_getAppl()).pcmf_getRenderer()
0590: .pcmf_addDlg(this );
0591: ((MuGenericApplication) this .pcmf_getAppl()).pcmf_getRenderer()
0592: .pcmf_rerenderDialogs();
0593:
0594: this .pcmf_setPropChanged(true);
0595:
0596: if (this .pdm_modal) {
0597: UnComponent l_appl = this .pcmf_getAppl()
0598: .pcmf_getUnComponent();
0599:
0600: l_appl.pcmf_getAllDisabled(pdm_modalChanges);
0601: this .pcmf_getAllDisabled(pdm_modalChangesDlg);
0602: l_appl.pcmf_disable();
0603: this .pcmf_enable();
0604:
0605: Iterator l_it = this .pdm_modalChangesDlg.iterator();
0606: while (l_it.hasNext())
0607: ((KeTreeNode) l_it.next()).pcmf_disable();
0608: }
0609:
0610: try {
0611: this .pcmf_setValue(IUnDialog.DIALOG_OPENED);
0612: this .pcmf_dispatchEvent();
0613: this .pcmf_setValue(IUnDialog.DIALOG_ACTIVATED);
0614: this .pcmf_dispatchEvent();
0615: } catch (Exception e) {
0616: KeLog.pcmf_logException("ug2t", this , e);
0617: }
0618:
0619: return;
0620: }
0621:
0622: public void pcmf_hideDialog() {
0623: if (!this .pdm_isDisplay)
0624: return;
0625:
0626: this .pdm_isDisplay = false;
0627: this .pcmf_setPropChanged(true);
0628:
0629: if (this .pdm_modal) {
0630: this .pdm_modalChangesDlg.clear();
0631: this .pcmf_getAllDisabled(pdm_modalChangesDlg);
0632:
0633: UnComponent l_appl = this .pcmf_getAppl()
0634: .pcmf_getUnComponent();
0635:
0636: l_appl.pcmf_enable();
0637: Iterator l_it = this .pdm_modalChanges.iterator();
0638: while (l_it.hasNext()) {
0639: Object l_obj = l_it.next();
0640: if (l_obj != this .pcmf_getAppl())
0641: ((KeTreeNode) l_obj).pcmf_disable();
0642: }
0643:
0644: this .pcmf_enable();
0645: l_it = this .pdm_modalChangesDlg.iterator();
0646: while (l_it.hasNext())
0647: ((KeTreeNode) l_it.next()).pcmf_disable();
0648:
0649: this .pdm_modalChanges.clear();
0650: this .pdm_modalChangesDlg.clear();
0651: }
0652: try {
0653: this .pcmf_setValue(IUnDialog.DIALOG_CLOSING);
0654: this .pcmf_dispatchEvent();
0655: this .pcmf_setValue(IUnDialog.DIALOG_CLOSED);
0656: this .pcmf_dispatchEvent();
0657: } catch (Exception e) {
0658: KeLog.pcmf_logException("ug2t", this , e);
0659: }
0660: }
0661:
0662: /**
0663: * <p>
0664: * Does...
0665: * </p>
0666: * <p>
0667: *
0668: * @return a Type with
0669: * </p>
0670: * <p>
0671: * @param
0672: * </p>
0673: */
0674: public boolean pcmf_isDisplay() {
0675: return (this .pdm_isDisplay);
0676: }
0677:
0678: /**
0679: * <p>
0680: * Does...
0681: * </p>
0682: * <p>
0683: *
0684: * @return a Type with
0685: * </p>
0686: * <p>
0687: * @param
0688: * </p>
0689: */
0690: public void pcmf_execListener(UnComponent xParam) throws Exception {
0691: this .pcmf_displayDialog();
0692: }
0693:
0694: public Object pcmf_execObj(Object xObj) {
0695: this .pcmf_displayDialog();
0696:
0697: return (this );
0698: }
0699:
0700: public void pcmf_toFront() {
0701: if (!((MuGenericApplication) this .pcmf_getAppl())
0702: .pcmf_getRenderer().pcmf_checkDialogStackTop(this )) {
0703: ((MuGenericApplication) this .pcmf_getAppl())
0704: .pcmf_getRenderer().pcmf_removeDlg(this );
0705: ((MuGenericApplication) this .pcmf_getAppl())
0706: .pcmf_getRenderer().pcmf_addDlg(this );
0707: ((MuGenericApplication) this .pcmf_getAppl())
0708: .pcmf_getRenderer().pcmf_rerenderDialogs();
0709:
0710: this .pcmf_setPropChanged(true);
0711: }
0712:
0713: try {
0714: this .pcmf_getUnComponent().pcmf_setValue(
0715: IUnDialog.DIALOG_ACTIVATED);
0716: this .pcmf_getUnComponent().pcmf_dispatchEvent();
0717: } catch (Exception e) {
0718: KeLog.pcmf_logException("ug2t", this , e);
0719: }
0720:
0721: return;
0722: }
0723:
0724: public void pcmf_setDrawSizeButtons(boolean xSb) {
0725: this .pdm_showSizeButs = xSb;
0726: return;
0727: }
0728:
0729: public void pcmf_setDrawWinCtrlButtons(boolean xCb) {
0730: this .pdm_showWCtrlButs = xCb;
0731: return;
0732: }
0733:
0734: /**
0735: * <p>
0736: * Sets the dialogue to be resizable
0737: * </p>
0738: * <p>
0739: *
0740: * </p>
0741: * <p>
0742: *
0743: * @param xSizable
0744: * true indicates that the dialogue is resizable, false does the
0745: * opposite
0746: * </p>
0747: */
0748: public void pcmf_setResizable(boolean xSizable) {
0749: if (this .pdm_isResizable == xSizable)
0750: return;
0751:
0752: this .pdm_isResizable = xSizable;
0753: this .pcmf_setPropChanged(true);
0754: }
0755:
0756: /**
0757: * <p>
0758: * Informs about the resizability of the dialogue
0759: * </p>
0760: * <p>
0761: *
0762: * </p>
0763: * <p>
0764: * </p>
0765: */
0766: public boolean pcmf_isResizable() {
0767: return (this .pdm_isResizable);
0768: }
0769:
0770: public void pcmf_setBgImage(IUnImage xImg) {
0771: if (this .pdm_bgImg == xImg)
0772: return;
0773:
0774: this .pdm_bgImg = xImg;
0775: this .pcmf_setPropChanged(true);
0776: }
0777:
0778: public IUnImage pcmf_getBgImage() {
0779: return (this .pdm_bgImg);
0780: };
0781:
0782: public void pcmf_setDecoration(boolean xDeco) {
0783: if (this .pdm_deco == xDeco)
0784: return;
0785:
0786: this .pdm_deco = xDeco;
0787: this .pcmf_setPropChanged(true);
0788: };
0789:
0790: public void pcmf_setScroll(boolean xScroll) {
0791: if (xScroll == this .pdm_scroll)
0792: return;
0793:
0794: pdm_scroll = xScroll;
0795: this .pcmf_setPropChanged(true);
0796: return;
0797: }
0798:
0799: public boolean pcmf_getScroll() {
0800: return (this .pdm_scroll);
0801: }
0802:
0803: public UnComponent pcmf_getSubmitClose() {
0804: return (this .pdm_submitClose.pcmf_getUnComponent());
0805: }
0806:
0807: public UnComponent pcmf_getSubmitLock() {
0808: return (this .pdm_submitLock.pcmf_getUnComponent());
0809: }
0810:
0811: public UnComponent pcmf_getSubmitFront() {
0812: return (this .pdm_submitFront.pcmf_getUnComponent());
0813: }
0814:
0815: public UnComponent pcmf_getSubmitMiMa() {
0816: return (this .pdm_submitMiMa.pcmf_getUnComponent());
0817: }
0818:
0819: public UnComponent pcmf_getSubmitWP() {
0820: return (this .pdm_submitWP.pcmf_getUnComponent());
0821: }
0822:
0823: public UnComponent pcmf_getSubmitWM() {
0824: return (this .pdm_submitWM.pcmf_getUnComponent());
0825: }
0826:
0827: public UnComponent pcmf_getSubmitHP() {
0828: return (this .pdm_submitHP.pcmf_getUnComponent());
0829: }
0830:
0831: public UnComponent pcmf_getSubmitHM() {
0832: return (this .pdm_submitHM.pcmf_getUnComponent());
0833: }
0834:
0835: public void pcmf_delete() throws Exception {
0836: if (this .pdm_deleted == true)
0837: return;
0838:
0839: IUnApplication l_appl = this .pcmf_getAppl();
0840: if (l_appl != null) {
0841: ((MuGenericApplication) l_appl).pcmf_getRenderer()
0842: .pcmf_removeDlg(this );
0843: ((MuGenericApplication) l_appl).pcmf_getRenderer()
0844: .pcmf_rerenderDialogs();
0845: }
0846:
0847: pdm_submitClose.pcmf_getUnComponent().pcmf_delete();
0848: pdm_submitLock.pcmf_getUnComponent().pcmf_delete();
0849: pdm_submitFront.pcmf_getUnComponent().pcmf_delete();
0850: pdm_submitMiMa.pcmf_getUnComponent().pcmf_delete();
0851: pdm_submitWP.pcmf_getUnComponent().pcmf_delete();
0852: pdm_submitWM.pcmf_getUnComponent().pcmf_delete();
0853: pdm_submitHP.pcmf_getUnComponent().pcmf_delete();
0854: pdm_submitHM.pcmf_getUnComponent().pcmf_delete();
0855: pdm_posMark.pcmf_delete();
0856: pdm_sizeMark.pcmf_delete();
0857:
0858: if (this .pem_wClose == null)
0859: pem_wClose.pcmf_getUnComponent().pcmf_delete();
0860: if (this .pem_wMin == null)
0861: pem_wMin.pcmf_getUnComponent().pcmf_delete();
0862: if (this .pem_wMax == null)
0863: pem_wMax.pcmf_getUnComponent().pcmf_delete();
0864: if (this .pem_wLock == null)
0865: pem_wLock.pcmf_getUnComponent().pcmf_delete();
0866: if (this .pem_wTop == null)
0867: pem_wTop.pcmf_getUnComponent().pcmf_delete();
0868:
0869: super .pcmf_delete();
0870:
0871: return;
0872: };
0873:
0874: public void pcmf_disable() {
0875: pdm_submitClose.pcmf_getUnComponent().pcmf_disable();
0876: pdm_submitLock.pcmf_getUnComponent().pcmf_disable();
0877: pdm_submitFront.pcmf_getUnComponent().pcmf_disable();
0878: pdm_submitMiMa.pcmf_getUnComponent().pcmf_disable();
0879: pdm_submitWP.pcmf_getUnComponent().pcmf_disable();
0880: pdm_submitWM.pcmf_getUnComponent().pcmf_disable();
0881: pdm_submitHP.pcmf_getUnComponent().pcmf_disable();
0882: pdm_submitHM.pcmf_getUnComponent().pcmf_disable();
0883:
0884: super .pcmf_disable();
0885: };
0886:
0887: public void pcmf_enable() {
0888: pdm_submitClose.pcmf_getUnComponent().pcmf_enable();
0889: pdm_submitLock.pcmf_getUnComponent().pcmf_enable();
0890: pdm_submitFront.pcmf_getUnComponent().pcmf_enable();
0891: pdm_submitMiMa.pcmf_getUnComponent().pcmf_enable();
0892: pdm_submitWP.pcmf_getUnComponent().pcmf_enable();
0893: pdm_submitWM.pcmf_getUnComponent().pcmf_enable();
0894: pdm_submitHP.pcmf_getUnComponent().pcmf_enable();
0895: pdm_submitHM.pcmf_getUnComponent().pcmf_enable();
0896:
0897: super .pcmf_enable();
0898: };
0899:
0900: public void pcmf_disableThis() {
0901: pdm_submitClose.pcmf_getUnComponent().pcmf_disable();
0902: pdm_submitLock.pcmf_getUnComponent().pcmf_disable();
0903: pdm_submitFront.pcmf_getUnComponent().pcmf_disable();
0904: pdm_submitMiMa.pcmf_getUnComponent().pcmf_disable();
0905: pdm_submitWP.pcmf_getUnComponent().pcmf_disable();
0906: pdm_submitWM.pcmf_getUnComponent().pcmf_disable();
0907: pdm_submitHP.pcmf_getUnComponent().pcmf_disable();
0908: pdm_submitHM.pcmf_getUnComponent().pcmf_disable();
0909:
0910: super .pcmf_disableThis();
0911: };
0912:
0913: public void pcmf_enableThis() {
0914: pdm_submitClose.pcmf_getUnComponent().pcmf_enable();
0915: pdm_submitLock.pcmf_getUnComponent().pcmf_enable();
0916: pdm_submitFront.pcmf_getUnComponent().pcmf_enable();
0917: pdm_submitMiMa.pcmf_getUnComponent().pcmf_enable();
0918: pdm_submitWP.pcmf_getUnComponent().pcmf_enable();
0919: pdm_submitWM.pcmf_getUnComponent().pcmf_enable();
0920: pdm_submitHP.pcmf_getUnComponent().pcmf_enable();
0921: pdm_submitHM.pcmf_getUnComponent().pcmf_enable();
0922:
0923: super .pcmf_enableThis();
0924: };
0925:
0926: public int pcmf_getHi() {
0927: Object l_obj = this .pdm_sizeMark.pcmf_getValue();
0928: if (l_obj == null || l_obj.equals(""))
0929: return (super .pcmf_getHi());
0930:
0931: return (this .pdm_sizeMark.pcmf_getHi());
0932: }
0933:
0934: public int pcmf_getWi() {
0935: Object l_obj = this .pdm_sizeMark.pcmf_getValue();
0936: if (l_obj == null || l_obj.equals(""))
0937: return (super .pcmf_getWi());
0938:
0939: return (this .pdm_sizeMark.pcmf_getWi());
0940: }
0941:
0942: public int pcmf_getXPos() {
0943: Object l_obj = this .pdm_posMark.pcmf_getValue();
0944: if (l_obj == null || l_obj.equals(""))
0945: return (super .pcmf_getXPos());
0946:
0947: return (this .pdm_posMark.pcmf_getX());
0948: }
0949:
0950: public int pcmf_getYPos() {
0951: Object l_obj = this .pdm_posMark.pcmf_getValue();
0952: if (l_obj == null || l_obj.equals(""))
0953: return (super .pcmf_getYPos());
0954:
0955: return (this .pdm_posMark.pcmf_getY());
0956: }
0957:
0958: public void pcmf_setPosition(int xPos, int yPos, int xWi, int xHi,
0959: String xAlign) {
0960: super .pcmf_setPosition(xPos, yPos, xWi, xHi, xAlign);
0961: this .pdm_posMark.pcmf_setValue("");
0962: this .pdm_sizeMark.pcmf_setValue("");
0963:
0964: return;
0965: };
0966:
0967: public void pcmf_setPosition(int xPos, int yPos, int xWi, int xHi) {
0968: this .pcmf_setPosition(xPos, yPos, xWi, xHi, "WEST");
0969:
0970: return;
0971: };
0972:
0973: public void pcmf_setModal(boolean xModal) {
0974: this .pdm_modal = xModal;
0975:
0976: return;
0977: }
0978:
0979: public boolean pcmf_isModal() {
0980: return (this .pdm_modal);
0981: }
0982:
0983: public boolean pcmf_getShowSizeButs() {
0984: return (this .pdm_showSizeButs);
0985: }
0986:
0987: public boolean pcmf_getShowCtrlButs() {
0988: return (this .pdm_showWCtrlButs);
0989: }
0990:
0991: public boolean pcmf_getDeco() {
0992: return (this .pdm_deco);
0993: }
0994:
0995: public boolean pcmf_getMini() {
0996: return (this .pem_mini);
0997: }
0998:
0999: // @@
1000:
1001: public void pcmf_setGenerateReshapeEvents(boolean xReshapes) {
1002: this .pem_submitReshapes = xReshapes;
1003: return;
1004: }
1005:
1006: public boolean pcmf_getGenerateReshapeEvents() {
1007: return (this .pem_submitReshapes);
1008: }
1009:
1010: public void pcmf_setTitle(String xTitle) {
1011: super .pcmf_setName(xTitle);
1012: }
1013:
1014: public String pcmf_getTitle() {
1015: return (super.pcmf_getName());
1016: }
1017:
1018: }
|