001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.console.config;
009:
010: //base classes
011: import java.io.InputStream;
012: import java.util.ArrayList;
013: import java.util.HashMap;
014: import org.w3c.dom.Node;
015:
016: //project specific classes
017: import org.jfolder.common.UnexpectedSystemException;
018: import org.jfolder.common.tagging.ConceptTagHelper;
019: import org.jfolder.common.tagging.ConceptTagPreferences;
020: import org.jfolder.common.tagging.ConceptTagPreferencesHelper;
021: import org.jfolder.common.tagging.ConceptTagSetContext;
022: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
023: import org.jfolder.common.tagging.RootConceptTagHolder;
024: import org.jfolder.common.utils.misc.MiscHelper;
025:
026: //other classes
027:
028: public class ConsoleConfigTagHelper extends ConceptTagHelper {
029:
030: public final static int AREA__MINIMUM_SIZE = 200;
031:
032: public static RootConceptTagHolder getRootHolder(InputStream inIs,
033: ConceptTagSetContext inCtsc) {
034: //
035: return ConceptTagHelper.getRootHolder(inIs,
036: new ConsoleConfigTagPreferences());
037: }
038:
039: public static RootConceptTagHolder getRootHolder(InputStream inIs) {
040: //
041: return ConceptTagHelper.getRootHolder(inIs,
042: new ConsoleConfigTagPreferences());
043: }
044:
045: public static RootConceptTagHolder getRootHolder(Node inNode,
046: ConceptTagSetContext inCtsc) {
047: //
048: return ConceptTagHelper.getRootHolder(inNode,
049: new ConsoleConfigTagPreferences());
050: }
051:
052: public static RootConceptTagHolder getRootHolder(Node inNode) {
053: //
054: return ConceptTagHelper.getRootHolder(inNode,
055: new ConsoleConfigTagPreferences());
056: }
057:
058: //
059: public final static ArrayList getAvailableScreens(
060: ConceptTagPreferences inCtp) {
061: //
062: ArrayList outValue = new ArrayList();
063:
064: String ctpHandle = inCtp.getPreferencesHandle();
065: if (ctpHandle
066: .equals(ConceptTagPreferencesHelper.CTP_PREF_HANDLE__WEB_PAGE)) {
067: //
068: outValue
069: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
070: outValue
071: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
072: outValue
073: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__WEB_PAGE_DISPLAY);
074: outValue
075: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT);
076: } else if (ctpHandle
077: .equals(ConceptTagPreferencesHelper.CTP_PREF_HANDLE__WORKFLOW_TEMPLATE)) {
078: //
079: outValue
080: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
081: outValue
082: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
083: outValue
084: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__WORKFLOW_TEMPLATE_GRAPH);
085: outValue
086: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT);
087: } else if (ctpHandle
088: .equals(ConceptTagPreferencesHelper.CTP_PREF_HANDLE__CONFIG_INSTANCE)) {
089: //
090: outValue
091: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
092: outValue
093: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
094: outValue
095: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT);
096: } else if (ctpHandle
097: .equals(ConceptTagPreferencesHelper.CTP_PREF_HANDLE__COMMON_FUNCTION)) {
098: //
099: outValue
100: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
101: outValue
102: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
103: outValue
104: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT);
105: } else if (ctpHandle
106: .equals(ConceptTagPreferencesHelper.CTP_PREF_HANDLE__CONSOLE_MACRO)) {
107: //
108: outValue
109: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
110: outValue
111: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
112: outValue
113: .add(ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT);
114: } else {
115: throw new UnexpectedSystemException(
116: "No Screens Available For Handle '" + ctpHandle
117: + "'");
118: }
119:
120: return outValue;
121: }
122:
123: //
124: //
125: //
126: public final static HashMap getContextToNameConversion() {
127:
128: HashMap outValue = new HashMap();
129:
130: //
131: outValue
132: .put(
133: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT,
134: ConsoleConfigTagPreferencesHelper.NAME__CONCEPT_TAG_EDIT);
135: //
136: outValue
137: .put(
138: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE,
139: ConsoleConfigTagPreferencesHelper.NAME__CONCEPT_TAG_TREE);
140: //
141: outValue
142: .put(
143: ConsoleConfigTagPreferencesHelper.CONTEXT__WEB_PAGE_DISPLAY,
144: ConsoleConfigTagPreferencesHelper.NAME__WEB_PAGE_DISPLAY);
145: //
146: outValue
147: .put(
148: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TEXT,
149: ConsoleConfigTagPreferencesHelper.NAME__CONCEPT_TAG_TEXT);
150: //
151: outValue
152: .put(
153: ConsoleConfigTagPreferencesHelper.CONTEXT__WORKFLOW_TEMPLATE_GRAPH,
154: ConsoleConfigTagPreferencesHelper.NAME__WORKFLOW_TEMPLATE_GRAPH);
155:
156: return outValue;
157: }
158:
159: //
160: //
161: public final static RootConceptTagHolder getDefaultConsoleConfigForWebPage() {
162:
163: RootConceptTagHolder outValue = getBaseRootHolder(
164: new ConsoleConfigTagPreferences(),
165: "org.jfolder.console.config.v1.RootV1ConsoleConfigTag",
166: true);
167:
168: //
169: MiscHelper
170: .println("ConConfTagHelp outValue.isErrorPresent() = "
171: + outValue.isErrorPresent());
172: //outValue.validate();
173: //
174: ConsoleConfig cc = (ConsoleConfig) outValue
175: .getFirstChildConceptTag();
176: //
177: cc
178: .addMainProperty(
179: 0,
180: ConsoleConfigTagPreferencesHelper.PROP_NAME__PREFERENCES_HANDLE,
181: ConceptTagPreferencesHelper.CTP_PREF_HANDLE__WEB_PAGE);
182: cc.addMainProperty(0,
183: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
184: ((AREA__MINIMUM_SIZE * 5) + ""));
185: cc.addMainProperty(0,
186: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
187: ((AREA__MINIMUM_SIZE * 3) + ""));
188: //
189: cc
190: .addLeftSectionPane(
191: 0,
192: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
193: cc.addLeftSectionPaneProperty(0, 0,
194: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
195: ((AREA__MINIMUM_SIZE * 1) + ""));
196: cc.addLeftSectionPaneProperty(0, 1,
197: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
198: ((AREA__MINIMUM_SIZE * 3) + ""));
199: //
200: cc
201: .addCenterSectionPane(
202: 0,
203: ConsoleConfigTagPreferencesHelper.CONTEXT__WEB_PAGE_DISPLAY);
204: cc.addCenterSectionPaneProperty(0, 0,
205: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
206: ((AREA__MINIMUM_SIZE * 4) + ""));
207: cc.addCenterSectionPaneProperty(0, 1,
208: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
209: ((AREA__MINIMUM_SIZE * 2) + ""));
210: //
211: cc
212: .addCenterSectionPane(
213: 1,
214: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
215: cc.addCenterSectionPaneProperty(1, 0,
216: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
217: ((AREA__MINIMUM_SIZE * 4) + ""));
218: cc.addCenterSectionPaneProperty(1, 1,
219: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
220: ((AREA__MINIMUM_SIZE * 1) + ""));
221: ////
222: //cc.addRightSectionPane(
223: // 0, ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
224: //cc.addRightSectionPaneProperty(
225: // 0, 0, ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
226: // ((AREA__MINIMUM_SIZE*1) + ""));
227: //cc.addRightSectionPaneProperty(
228: // 0, 1, ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
229: // ((AREA__MINIMUM_SIZE*2) + ""));
230:
231: return outValue;
232: }
233:
234: public final static RootConceptTagHolder getDefaultConsoleConfigForWebPageOrig() {
235:
236: RootConceptTagHolder outValue = getBaseRootHolder(
237: new ConsoleConfigTagPreferences(),
238: "org.jfolder.console.config.v1.RootV1ConsoleConfigTag",
239: true);
240:
241: //
242: MiscHelper
243: .println("ConConfTagHelp outValue.isErrorPresent() = "
244: + outValue.isErrorPresent());
245: //outValue.validate();
246: //
247: ConsoleConfig cc = (ConsoleConfig) outValue
248: .getFirstChildConceptTag();
249: //
250: cc
251: .addMainProperty(
252: 0,
253: ConsoleConfigTagPreferencesHelper.PROP_NAME__PREFERENCES_HANDLE,
254: ConceptTagPreferencesHelper.CTP_PREF_HANDLE__WEB_PAGE);
255: cc.addMainProperty(0,
256: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
257: "600");
258: cc.addMainProperty(0,
259: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
260: "400");
261: //
262: cc
263: .addLeftSectionPane(
264: 0,
265: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_TREE);
266: cc.addLeftSectionPaneProperty(0, 0,
267: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
268: "200");
269: cc.addLeftSectionPaneProperty(0, 1,
270: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
271: "400");
272: //
273: cc
274: .addCenterSectionPane(
275: 0,
276: ConsoleConfigTagPreferencesHelper.CONTEXT__WEB_PAGE_DISPLAY);
277: cc.addCenterSectionPaneProperty(0, 0,
278: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
279: "400");
280: cc.addCenterSectionPaneProperty(0, 1,
281: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
282: "200");
283: //
284: cc
285: .addCenterSectionPane(
286: 1,
287: ConsoleConfigTagPreferencesHelper.CONTEXT__CONCEPT_TAG_EDIT);
288: cc.addCenterSectionPaneProperty(1, 0,
289: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
290: "400");
291: cc.addCenterSectionPaneProperty(1, 1,
292: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
293: "200");
294:
295: return outValue;
296: }
297:
298: //
299: //
300: //
301: //
302: //
303: //
304: //
305: //
306: public final static void createLeftSectionPane(ConsoleConfig inCc,
307: int inIndex, String inContext, HashMap inProps) {
308: //
309:
310: //
311: inCc.addLeftSectionPane(inIndex, inContext);
312: //
313: ArrayList propNames = new ArrayList(inProps.keySet());
314: for (int i = 0; i < propNames.size(); i++) {
315: String nextPropName = (String) propNames.get(i);
316: String nextPropValue = (String) inProps.get(nextPropName);
317: inCc.addLeftSectionPaneProperty(inIndex, i, nextPropName,
318: nextPropValue);
319: }
320:
321: //
322: String leftPaneWidth = inCc.getLeftSectionPaneProperty(inIndex,
323: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
324: adjustMainWidth(inCc, Integer.parseInt(leftPaneWidth));
325:
326: }
327:
328: public final static void removeLeftSectionPane(ConsoleConfig inCc,
329: int inIndex) {
330: //
331:
332: //
333: String leftPaneWidth = inCc.getLeftSectionPaneProperty(inIndex,
334: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
335: adjustMainWidth(inCc, -(Integer.parseInt(leftPaneWidth)));
336:
337: //
338: inCc.removeLeftSectionPane(inIndex);
339: }
340:
341: public final static void adjustLeftSectionPaneHorizontally(
342: ConsoleConfig inCc, int inIndex, int inDelta) {
343: //
344:
345: //
346: //
347: adjustLeftSectionPaneWidth(inCc, inIndex, inDelta);
348:
349: //
350: //
351: //
352: adjustMainWidth(inCc, inDelta);
353: }
354:
355: public final static void adjustLeftSectionPaneVertically(
356: ConsoleConfig inCc, int inIndex, int inDelta) {
357: //
358:
359: //
360: adjustMainHeight(inCc, inDelta);
361:
362: //
363: adjustLeftSectionPaneHeights(inCc, inDelta);
364:
365: //
366: if (inCc.getCenterSectionPaneCount() > 0) {
367: adjustCenterSectionPaneHeight(inCc, inCc
368: .getCenterSectionPaneCount() - 1, inDelta);
369: }
370:
371: //
372: adjustRightSectionPaneHeights(inCc, inDelta);
373: }
374:
375: //
376: //
377: //
378: //
379: //
380: public final static void createCenterSectionPane(
381: ConsoleConfig inCc, int inIndex, String inContext,
382: HashMap inProps) {
383: //
384:
385: boolean noCenterPanesPresent = (inCc
386: .getCenterSectionPaneCount() == 0);
387:
388: //
389: inCc.addCenterSectionPane(inIndex, inContext);
390: //
391: ArrayList propNames = new ArrayList(inProps.keySet());
392: for (int i = 0; i < propNames.size(); i++) {
393: String nextPropName = (String) propNames.get(i);
394: String nextPropValue = (String) inProps.get(nextPropName);
395: if (noCenterPanesPresent
396: || !nextPropName
397: .equals(ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH)) {
398: //
399: inCc.addCenterSectionPaneProperty(inIndex, i,
400: nextPropName, nextPropValue);
401: } else {
402: //
403: String centerWidth = inCc
404: .getCenterSectionPaneProperty(
405: 0,
406: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
407: //
408: inCc.addCenterSectionPaneProperty(inIndex, i,
409: nextPropName, centerWidth);
410:
411: }
412: }
413:
414: if (noCenterPanesPresent) {
415: String paneWidthString = (String) inProps
416: .get(ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
417: adjustMainWidth(inCc, Integer.parseInt(paneWidthString));
418: } else {
419: //
420: String centerPaneHeightString = inCc
421: .getCenterSectionPaneProperty(
422: inIndex,
423: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
424: int centerPaneHeight = Integer
425: .parseInt(centerPaneHeightString);
426:
427: //
428: adjustMainHeight(inCc, centerPaneHeight);
429: adjustLeftSectionPaneHeights(inCc, centerPaneHeight);
430: adjustRightSectionPaneHeights(inCc, centerPaneHeight);
431: }
432:
433: }
434:
435: public final static void removeCenterSectionPane(
436: ConsoleConfig inCc, int inIndex) {
437: //
438:
439: //
440: String centerPaneHeightString = inCc
441: .getCenterSectionPaneProperty(
442: inIndex,
443: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
444: int centerPaneHeight = Integer.parseInt(centerPaneHeightString);
445:
446: //
447: if (inCc.getCenterSectionPaneCount() > 1) {
448: adjustMainHeight(inCc, -centerPaneHeight);
449: adjustLeftSectionPaneHeights(inCc, -centerPaneHeight);
450: adjustRightSectionPaneHeights(inCc, -centerPaneHeight);
451: }
452:
453: //
454: inCc.removeCenterSectionPane(inIndex);
455: }
456:
457: public final static void adjustCenterSectionPaneHorizontally(
458: ConsoleConfig inCc, int inIndex, int inDelta) {
459: //
460: adjustMainWidth(inCc, inDelta);
461: adjustCenterSectionPaneWidths(inCc, inDelta);
462: }
463:
464: public final static void adjustCenterSectionPaneVertically(
465: ConsoleConfig inCc, int inIndex, int inDelta) {
466: //
467: adjustCenterSectionPaneHeight(inCc, inIndex, inDelta);
468: //
469: adjustMainHeight(inCc, inDelta);
470: adjustLeftSectionPaneHeights(inCc, inDelta);
471: adjustRightSectionPaneHeights(inCc, inDelta);
472: }
473:
474: //
475: //
476: //
477: //
478: //
479: public final static void createRightSectionPane(ConsoleConfig inCc,
480: int inIndex, String inContext, HashMap inProps) {
481: //
482: inCc.addRightSectionPane(inIndex, inContext);
483: //
484: ArrayList propNames = new ArrayList(inProps.keySet());
485: for (int i = 0; i < propNames.size(); i++) {
486: String nextPropName = (String) propNames.get(i);
487: String nextPropValue = (String) inProps.get(nextPropName);
488: inCc.addRightSectionPaneProperty(inIndex, i, nextPropName,
489: nextPropValue);
490: }
491:
492: //
493: String rightPaneWidth = inCc.getRightSectionPaneProperty(
494: inIndex,
495: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
496: adjustMainWidth(inCc, Integer.parseInt(rightPaneWidth));
497: }
498:
499: public final static void removeRightSectionPane(ConsoleConfig inCc,
500: int inIndex) {
501: //
502:
503: //
504: String rightPaneWidth = inCc.getRightSectionPaneProperty(
505: inIndex,
506: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
507: adjustMainWidth(inCc, -(Integer.parseInt(rightPaneWidth)));
508:
509: //
510: inCc.removeRightSectionPane(inIndex);
511: }
512:
513: public final static void adjustRightSectionPaneHorizontally(
514: ConsoleConfig inCc, int inIndex, int inDelta) {
515: //
516:
517: //
518: //
519: adjustRightSectionPaneWidth(inCc, inIndex, inDelta);
520:
521: //
522: //
523: //
524: adjustMainWidth(inCc, inDelta);
525: }
526:
527: public final static void adjustRightSectionPaneVertically(
528: ConsoleConfig inCc, int inIndex, int inDelta) {
529: //
530:
531: //
532: adjustMainHeight(inCc, inDelta);
533:
534: //
535: adjustLeftSectionPaneHeights(inCc, inDelta);
536:
537: //
538: if (inCc.getCenterSectionPaneCount() > 0) {
539: adjustCenterSectionPaneHeight(inCc, inCc
540: .getCenterSectionPaneCount() - 1, inDelta);
541: }
542:
543: //
544: adjustRightSectionPaneHeights(inCc, inDelta);
545: }
546:
547: //
548: //
549: //
550: //
551: //
552: //
553: //
554: //
555: //
556: //
557: //
558: //
559: //
560: //
561: //
562: //
563: //
564: private final static void adjustMainWidth(ConsoleConfig inCc,
565: int inDx) {
566: //
567: //
568: //
569: int mainWidthIndex = inCc
570: .getMainPropertyIndex(ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
571: String mainWidth = inCc.getMainPropertyValue(mainWidthIndex);
572: int updatedMainWidth = (Integer.parseInt(mainWidth) + inDx);
573: inCc.removeMainProperty(mainWidthIndex);
574: inCc.addMainProperty(mainWidthIndex,
575: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
576: (updatedMainWidth + ""));
577: }
578:
579: private final static void adjustMainHeight(ConsoleConfig inCc,
580: int inDy) {
581: //
582: //
583: //
584: int mainHeightIndex = inCc
585: .getMainPropertyIndex(ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
586: String mainHeight = inCc.getMainPropertyValue(mainHeightIndex);
587: int updatedMainHeight = (Integer.parseInt(mainHeight) + inDy);
588: inCc.removeMainProperty(mainHeightIndex);
589: inCc.addMainProperty(mainHeightIndex,
590: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
591: (updatedMainHeight + ""));
592: }
593:
594: //
595: private final static void adjustLeftSectionPaneHeights(
596: ConsoleConfig inCc, int inDy) {
597: //
598: for (int i = 0; i < inCc.getLeftSectionPaneCount(); i++) {
599: adjustLeftSectionPaneHeight(inCc, i, inDy);
600: }
601: }
602:
603: private final static void adjustRightSectionPaneHeights(
604: ConsoleConfig inCc, int inDy) {
605: //
606: for (int i = 0; i < inCc.getRightSectionPaneCount(); i++) {
607: adjustRightSectionPaneHeight(inCc, i, inDy);
608: }
609: }
610:
611: private final static void adjustCenterSectionPaneWidths(
612: ConsoleConfig inCc, int inDy) {
613: //
614: for (int i = 0; i < inCc.getCenterSectionPaneCount(); i++) {
615: adjustCenterSectionPaneWidth(inCc, i, inDy);
616: }
617: }
618:
619: //
620: private final static void adjustLeftSectionPaneWidth(
621: ConsoleConfig inCc, int inIndex, int inDx) {
622: //
623: //
624: int leftPaneWidthIndex = inCc.getLeftSectionPanePropertyIndex(
625: inIndex,
626: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
627: String leftPaneWidth = inCc.getLeftSectionPanePropertyValue(
628: inIndex, leftPaneWidthIndex);
629: int updatedLeftPaneWidth = Integer.parseInt(leftPaneWidth)
630: + inDx;
631: //
632: inCc.removeLeftSectionPaneProperty(inIndex, leftPaneWidthIndex);
633: inCc.addLeftSectionPaneProperty(inIndex, leftPaneWidthIndex,
634: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
635: (updatedLeftPaneWidth + ""));
636: }
637:
638: private final static void adjustLeftSectionPaneHeight(
639: ConsoleConfig inCc, int inIndex, int inDy) {
640: //
641: //
642: int leftPaneHeightIndex = inCc.getLeftSectionPanePropertyIndex(
643: inIndex,
644: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
645: String leftPaneHeight = inCc.getLeftSectionPanePropertyValue(
646: inIndex, leftPaneHeightIndex);
647: int updatedLeftPaneHeight = Integer.parseInt(leftPaneHeight)
648: + inDy;
649: //
650: inCc
651: .removeLeftSectionPaneProperty(inIndex,
652: leftPaneHeightIndex);
653: inCc.addLeftSectionPaneProperty(inIndex, leftPaneHeightIndex,
654: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
655: (updatedLeftPaneHeight + ""));
656: }
657:
658: private final static void adjustCenterSectionPaneWidth(
659: ConsoleConfig inCc, int inIndex, int inDx) {
660: //
661: //
662: int centerPaneWidthIndex = inCc
663: .getCenterSectionPanePropertyIndex(
664: inIndex,
665: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
666: String centerPaneWidth = inCc
667: .getCenterSectionPanePropertyValue(inIndex,
668: centerPaneWidthIndex);
669: int updatedCenterPaneWidth = Integer.parseInt(centerPaneWidth)
670: + inDx;
671: //
672: inCc.removeCenterSectionPaneProperty(inIndex,
673: centerPaneWidthIndex);
674: inCc.addCenterSectionPaneProperty(inIndex,
675: centerPaneWidthIndex,
676: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
677: (updatedCenterPaneWidth + ""));
678: }
679:
680: private final static void adjustCenterSectionPaneHeight(
681: ConsoleConfig inCc, int inIndex, int inDy) {
682: //
683: //
684: int centerPaneHeightIndex = inCc
685: .getCenterSectionPanePropertyIndex(
686: inIndex,
687: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
688: String centerPaneHeight = inCc
689: .getCenterSectionPanePropertyValue(inIndex,
690: centerPaneHeightIndex);
691: int updatedCenterPaneHeight = Integer
692: .parseInt(centerPaneHeight)
693: + inDy;
694: //
695: inCc.removeCenterSectionPaneProperty(inIndex,
696: centerPaneHeightIndex);
697: inCc.addCenterSectionPaneProperty(inIndex,
698: centerPaneHeightIndex,
699: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
700: (updatedCenterPaneHeight + ""));
701: }
702:
703: private final static void adjustRightSectionPaneWidth(
704: ConsoleConfig inCc, int inIndex, int inDx) {
705: //
706: //
707: int rightPaneWidthIndex = inCc
708: .getRightSectionPanePropertyIndex(
709: inIndex,
710: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
711: String rightPaneWidth = inCc.getRightSectionPanePropertyValue(
712: inIndex, rightPaneWidthIndex);
713: int updatedRightPaneWidth = Integer.parseInt(rightPaneWidth)
714: + inDx;
715: //
716: inCc.removeRightSectionPaneProperty(inIndex,
717: rightPaneWidthIndex);
718: inCc.addRightSectionPaneProperty(inIndex, rightPaneWidthIndex,
719: ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH,
720: (updatedRightPaneWidth + ""));
721: }
722:
723: private final static void adjustRightSectionPaneHeight(
724: ConsoleConfig inCc, int inIndex, int inDy) {
725: //
726: //
727: int rightPaneHeightIndex = inCc
728: .getRightSectionPanePropertyIndex(
729: inIndex,
730: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT);
731: String rightPaneHeight = inCc.getRightSectionPanePropertyValue(
732: inIndex, rightPaneHeightIndex);
733: int updatedRightPaneHeight = Integer.parseInt(rightPaneHeight)
734: + inDy;
735: //
736: inCc.removeRightSectionPaneProperty(inIndex,
737: rightPaneHeightIndex);
738: inCc.addRightSectionPaneProperty(inIndex, rightPaneHeightIndex,
739: ConsoleConfigTagPreferencesHelper.PROP_NAME__HEIGHT,
740: (updatedRightPaneHeight + ""));
741: }
742: }
|