/* (non-Javadoc) * @see de.enough.polish.ui.ContainerView#setStyle(de.enough.polish.ui.Style) */ protected void setStyle(Style style) { super.setStyle(style); // #if polish.css.fisheyeview-remove-text Boolean removeTextBool = style.getBooleanProperty("fisheyeview-remove-text"); if (removeTextBool != null) { this.isRemoveText = removeTextBool.booleanValue(); } // #endif // #if polish.css.fisheyeview-scale && polish.midp2 Integer scaleInt = style.getIntProperty("fisheyeview-scale"); if (scaleInt != null) { this.scaleFactorWidth = scaleInt.intValue(); } // #endif // #if polish.css.show-text-in-title Boolean showTextInTitleBool = style.getBooleanProperty("show-text-in-title"); if (showTextInTitleBool != null) { this.isShowTextInTitle = showTextInTitleBool.booleanValue(); if (this.isShowTextInTitle) { this.isRemoveText = true; } } // #endif // #if polish.css.fisheyeview-max-visible Integer maxVisibleItemsInt = style.getIntProperty("fisheyeview-max-visible"); if (maxVisibleItemsInt != null) { this.maxVisibleItems = maxVisibleItemsInt.intValue(); } // #endif }
/* (non-Javadoc) * @see de.enough.polish.ui.ScreenChangeAnimation#setStyle(de.enough.polish.ui.Style) */ protected void setStyle(Style style) { super.setStyle(style); if (this.isForwardAnimation) { this.currentY = 0; } else { this.currentY = this.screenHeight; } // #if polish.css.bottom-screen-change-animation-speed Integer speedInt = style.getIntProperty("bottom-screen-change-animation-speed"); if (speedInt != null) { this.speed = speedInt.intValue(); } else { this.speed = -1; } // #endif }
protected void setStyle(Style style) { super.setStyle(style); // #ifdef polish.css.horizontalview-roundtrip Boolean allowRoundTripBool = style.getBooleanProperty("horizontalview-roundtrip"); if (allowRoundTripBool != null) { this.allowRoundTrip = allowRoundTripBool.booleanValue(); } // #endif // #if polish.css.horizontalview-align-heights Boolean alignHeightsBools = style.getBooleanProperty("horizontalview-align-heights"); if (alignHeightsBools != null) { this.isAlignHeights = alignHeightsBools.booleanValue(); } // #endif // #if polish.css.show-text-in-title Boolean showTextInTitleBool = style.getBooleanProperty("show-text-in-title"); if (showTextInTitleBool != null) { this.isShowTextInTitle = showTextInTitleBool.booleanValue(); } // #endif // #if polish.css.horizontalview-distribution Integer distribution = style.getIntProperty("horizontalview-distribution"); if (distribution != null) { this.isDistributeEquals = (distribution.intValue() == DISTRIBUTE_EQUALS); } // #endif // #if polish.css.horizontalview-arrow-left String urlLeft = style.getProperty("horizontalview-arrow-left"); if (urlLeft != null) { setArrowLeft(urlLeft); } // #endif // #if polish.css.horizontalview-arrow-right String urlRight = style.getProperty("horizontalview-arrow-right"); if (urlRight != null) { setArrowRight(urlRight); } // #endif }
private Style createTextStyle(Style baseStyle, Style extendStyle) { if (baseStyle != null && extendStyle != null) { if (baseStyle.name.equals(extendStyle.name)) { return baseStyle; } } // #mdebug sl.debug.style if (baseStyle != null) { System.out.println("creating text style : " + baseStyle.name + " / " + extendStyle.name); } else { System.out.println("creating text style from " + extendStyle.name); } // #enddebug Style resultStyle = new Style(defaultTextStyle); // get the attributes to extend the style /*String x = extendStyle.getProperty("float"); String y = extendStyle.getProperty("display");*/ Color extendFontColor = extendStyle.getColorProperty("font-color"); Integer extendFontStyle = extendStyle.getIntProperty("font-style"); Integer extendFontSize = extendStyle.getIntProperty("font-size"); Style extendFocusedStyle = getFocusedStyle(extendStyle); /* extendFontSize = extendStyle.getIntProperty("margin-left"); extendFontSize = extendStyle.getIntProperty("margin-right"); extendFontSize = extendStyle.getIntProperty("margin-top"); extendFontSize = extendStyle.getIntProperty("margin-bottom"); extendFontSize = extendStyle.getIntProperty("padding-left"); extendFontSize = extendStyle.getIntProperty("padding-right"); extendFontSize = extendStyle.getIntProperty("padding-top"); extendFontSize = extendStyle.getIntProperty("padding-bottom"); */ // if a base style is given ... if (baseStyle == null) { resultStyle.name = extendStyle.name; resultStyle.addAttribute("font-color", extendFontColor); resultStyle.addAttribute("font-style", extendFontStyle); resultStyle.addAttribute("font-size", extendFontSize); resultStyle.addAttribute("focused-style", extendFocusedStyle); } else { // get default size and color from text style Integer defaultFontSize = resultStyle.getIntProperty("font-size"); Color defaultFontColor = resultStyle.getColorProperty("font-color"); // get font attributes from the base style Color baseFontColor = baseStyle.getColorProperty("font-color"); Integer baseFontStyle = baseStyle.getIntProperty("font-style"); Integer baseFontSize = baseStyle.getIntProperty("font-size"); Color resultTextColor = (Color) extendValue(baseFontColor, extendFontColor, defaultFontColor); Integer resultTextStyle = extendFlag(baseFontStyle, extendFontStyle); Integer resultTextSize = (Integer) extendValue(baseFontSize, extendFontSize, defaultFontSize); Style baseFocusedStyle = getFocusedStyle(baseStyle); // add the resulting attributes to the text style resultStyle.name = baseStyle.name + "." + extendStyle.name; resultStyle.addAttribute("font-color", resultTextColor); resultStyle.addAttribute("font-style", resultTextStyle); resultStyle.addAttribute("font-size", resultTextSize); // extend the focused style if (extendFocusedStyle != null) { Style resultFocusedStyle = createTextStyle(baseFocusedStyle, extendFocusedStyle); resultStyle.addAttribute("focused-style", resultFocusedStyle); } } return resultStyle; }