private Layer getLayer1(int i) { Layer layerInfo = new Layer(Layer.DIV); // layerInfo.setOverflow("hidden"); // layerInfo.setVisibility("visible"); layerInfo.setPositionType("relative"); // layerInfo.setHeight("16"); layerInfo.setWidth("240"); layerInfo.setID("lay" + i + "_1"); // layerInfo.setMarkupAttribute("class", "ehealth_div_top"); layerInfo.setStyleClass("ehealth_div_top"); Link text1 = new Link(); text1.setNoURL(); text1.setID("text" + i + "_1"); if (age != null && age.getYears() >= 70) { if (i == 1) { text1.setText("VÅRDBEGÄRAN 2004-05-05 Läk mott.besök"); } else if (i == 2) { text1.setText("Vårdbegäran 2004-06-05 Läk mott.besök"); } else text1.setText(""); } else { if (i == 1) { text1.setText("Vårdbegäran 2004-05-05 Läk mott.besök"); } else if (i == 2) { text1.setText("Vårdbegäran 2004-06-18 Inskrivning"); } else text1.setText(""); } text1.setOnClick("javascript:showHideLayer(" + i + ", 1);return false;"); layerInfo.add(text1); return layerInfo; }
// private Layer getNavigationTree(IWContext iwc) { private Layer getNavigationTree() { Layer layersNav = new Layer(Layer.DIV); layersNav.setOverflow("scroll"); layersNav.setPositionType("relative"); layersNav.setWidth("320"); layersNav.setHeight("400"); layersNav.setStyleClass("ehealth_div_no_border"); // layersNav.setMarkupAttribute("class", "ehealth_div"); layersNav.setBackgroundImage(imageBgVertOut); Table table = new Table(3, 20); table.setNoWrap(); table.setCellpadding(0); table.setCellspacing(0); table.setBorder(0); table.setWidth("280"); table.setHeight("350"); int row = 1; int i = 1; for (i = 1; i <= 4; i++) { table.mergeCells(2, row, 3, row); if (i <= 2) { table.add(getLayer1(i), 2, row); table.setHeight(1, row, "16"); table.setHeight(2, row, "16"); table.setWidth(1, row, "16"); table.setWidth(2, row, "16"); table.setVerticalAlignment(1, row, Table.VERTICAL_ALIGN_TOP); table.add(imageCircleD, 1, row++); } // table.setBackgroundImage(1, row, imageBgVert); table.setHeight(2, row, "16"); table.setVerticalAlignment(1, row, Table.VERTICAL_ALIGN_TOP); table.add(getLayer2(i), 2, row++); table.setBackgroundImage(1, row, imageBgVert); table.setHeight(1, row, "20"); table.setVerticalAlignment(1, row, Table.VERTICAL_ALIGN_TOP); table.add(getLayer3(i), 2, row++); table.setHeight(1, row, "10"); table.setVerticalAlignment(1, row, Table.VERTICAL_ALIGN_TOP); table.setBackgroundImage(1, row++, imageBgVert); /*table.add(getLayer1(i), 2, row); table.add(getLayer2(i), 2, row); table.add(getLayer3(i), 2, row); */ } table.setVerticalAlignment(1, row, Table.VERTICAL_ALIGN_TOP); table.setHeight(1, row, "25"); table.setBackgroundImage(1, row++, imageBgVert); layersNav.add(table); return layersNav; }
private Layer getLayer3(int i) { Layer layerInfo = new Layer(Layer.DIV); layerInfo.setOverflow("hidden"); layerInfo.setVisibility("hidden"); layerInfo.setPositionType("relative"); layerInfo.setHeight("20"); layerInfo.setWidth("260"); layerInfo.setID("lay" + i + "_3"); // layerInfo.setStyleClass("ehealth_div_no_border"); layerInfo.setStyleClass("ehealth_row_outer_div"); // layerInfo.setLeftPosition("10"); layerInfo.setTopPosition("0"); layerInfo.add(getInfoLayer(i)); return layerInfo; }
public UIComponent getOverviewForm() { Form myForm = new Form(); myForm.setName(prmForm); Table T = new Table(3, 3); T.setCellpadding(0); T.setCellspacing(0); T.setBorder(0); T.setBorderColor("#000000"); T.setVerticalAlignment(1, 1, Table.VERTICAL_ALIGN_TOP); T.setVerticalAlignment(3, 1, Table.VERTICAL_ALIGN_TOP); // T.setVerticalAlignment(1, 4, Table.VERTICAL_ALIGN_BOTTOM); // T.add(getNavigationTree(iwc), 1, 1); T.add(getNavigationTree(), 1, 1); // T.add(getInfoLayer(), 2, 1); T.add(new Break(3), 3, 1); // T.setHeight(1, 3, "130"); // T.setHeight(1, 4, "90"); T.setWidth(2, 1, "40"); myForm.add(T); Page pVisit = this.getParentPage(); if (pVisit != null) { Script S = pVisit.getAssociatedScript(); // pVisit.setOnLoad("setRowColor(document.getElementById('inf1_1'));"); S.addFunction("setRowColor(obj)", setRowColorScript()); S.addFunction("showHideLayer(obj)", showHideLayerScript()); Script timeScript = myForm.getAssociatedFormScript(); if (timeScript == null) { timeScript = new Script(); myForm.setAssociatedFormScript(timeScript); } } ArrayList texts1 = new ArrayList(); ArrayList texts2 = new ArrayList(); if (age != null && age.getYears() >= 70) { texts1.add(localize(keySet1Text1U1, "Texten")); texts1.add(localize(keySet1Text2U1, "Texten")); texts1.add(localize(keySet1Text3U1, "Texten")); texts1.add(localize(keySet1Text4U1, "Texten")); texts1.add(localize(keySet1Text5U1, "Texten")); texts2.add(localize(keySet2Text1U1, "Texten")); texts2.add(localize(keySet2Text2U1, "Texten")); texts2.add(localize(keySet2Text3U1, "Texten")); texts2.add(localize(keySet2Text4U1, "Texten")); texts2.add(localize(keySet2Text5U1, "Texten")); } else { texts1.add(localize(keySet1Text1U2, "Texten")); texts1.add(localize(keySet1Text2U2, "Texten")); texts1.add(localize(keySet1Text3U2, "Texten")); texts1.add(localize(keySet1Text4U2, "Texten")); texts1.add(localize(keySet1Text5U2, "Texten")); texts2.add(localize(keySet2Text1U2, "Texten")); texts2.add(localize(keySet2Text2U2, "Texten")); texts2.add(localize(keySet2Text3U2, "Texten")); texts2.add(localize(keySet2Text4U2, "Texten")); texts2.add(localize(keySet2Text5U2, "Texten")); } Layer layerOut = new Layer(Layer.DIV); layerOut.setVisibility("visible"); layerOut.setOverflow("scroll"); layerOut.setPositionType("absolute"); layerOut.setWidth("280"); layerOut.setHeight("170"); layerOut.setMarkupAttribute("class", "ehealth_div"); Layer layer = new Layer(Layer.DIV); layer.setVisibility("hidden"); layer.setOverflow("hidden"); layer.setPositionType("absolute"); layer.setWidth("250"); layer.setHeight("145"); layer.setMarkupAttribute("class", "ehealth_div_no_border"); int theRow = 1; int i = 1; Iterator iter1 = texts1.iterator(); Iterator iter2 = texts2.iterator(); while (iter1.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("info" + i + "_" + theRow); String text = (String) iter1.next(); layers.add(text); layerOut.add(layers); theRow++; } i++; theRow = 1; while (iter2.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("info" + i + "_" + theRow); String text = (String) iter2.next(); layers.add(text); layerOut.add(layers); theRow++; } T.add(layerOut, 3, 1); return myForm; }
private Layer getInfoLayer(int theCase) { Layer layerInfo = new Layer(Layer.DIV); // layerInfo.setOverflow("hidden"); // layerInfo.setVisibility("hidden"); layerInfo.setPositionType("relative"); layerInfo.setWidth("270"); layerInfo.setHeight("100"); layerInfo.setStyleClass("ehealth_row_outer_div"); Table tableInfo = new Table(1, 10); tableInfo.setNoWrap(); tableInfo.setCellpadding(0); tableInfo.setCellspacing(0); tableInfo.setBorder(0); // tableInfo.setWidth(200); int column = 1; tableInfo.setWidth(column, 1, "200"); // tableInfo.setWidth(column++, 1, "70"); Image transpImg = Table.getTransparentCell(_iwc); transpImg.setWidth(15); transpImg.setHeight(16); Layer layer = new Layer(Layer.DIV); layer.setOnMouseOver("setRowColor(this);"); layer.setPositionType("relative"); // layer.setHeight(20); layer.setStyleClass("ehealth_row_div"); Image corners = getBundle(_iwc).getImage("thirdLevel.gif"); corners.setBorder(0); corners.setHeight(16); corners.setWidth(19); layer.setBackgroundImage(corners); int theRow = 1; ArrayList cases = new ArrayList(); if (age != null && age.getYears() >= 70) { if (theCase == 1) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); cases.add("Remisser och svar:"); // cases.add("Läkemedel:"); } else if (theCase == 2) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); cases.add("Remisser och svar:"); } } else { if (theCase == 1) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); // cases.add("Läkemedel:"); } else if (theCase == 2) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); // cases.add("Läkemedel:"); } } Iterator iter = cases.iterator(); while (iter.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("inf" + theCase + "_" + theRow); String text = (String) iter.next(); layers.add(text); tableInfo.add(layers, column, theRow); theRow++; } layerInfo.add(tableInfo); return layerInfo; }