public static Style narrowToOpenLayersStyle(JSObject element) { return (element == null) ? null: new Style(element); } }
Style style = new Style(); style.background = new BorderedSimpleBackground(0xF0F0F0, 0xFF0000, 1); item.setStyle(style);
PdfFont normalFont = PdfFontFactory.createFont(fontDirectory.getAbsolutePath()+"\\arial.ttf", "Identity-H", true); normal.setFont(normalFont).setFontSize(14); Style red = new Style(); PdfFont redFont = PdfFontFactory.createFont(fontDirectory.getAbsolutePath()+"\\arial.ttf", "Identity-H", true); red.setFont(redFont).setFontSize(14).setFontColor(Color.RED); Style big = new Style(); PdfFont bigFont = PdfFontFactory.createFont(fontDirectory.getAbsolutePath()+"\\arial.ttf", "Identity-H", true); big.setFont(bigFont).setFontSize(18).setBold();
Style style = new Style(); // You can set other attributes here style.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED); configRegistry.registerConfigAttribute( CellConfigAttributes.CELL_STYLE, // attribute to apply style, // value of the attribute DisplayMode.NORMAL, // apply during normal rendering CELL_LABEL); // apply for all cells with this label
Style detailStyle = new Style(); detailStyle.setBorderTop(Border.THIN); detailStyle.setBorderBottom(Border.THIN); detailStyle.setBorderRight(Border.THIN); Style headerStyle = new Style(); headerStyle.setFont(Font.ARIAL_MEDIUM_BOLD); headerStyle.setBorderBottom(Border.THIN); headerStyle.setTransparency(Transparency.OPAQUE); Style headerVariables = new Style(); headerVariables.setFont(Font.ARIAL_MEDIUM_BOLD); headerVariables.setHorizontalAlign(HorizontalAlign.RIGHT); headerVariables.setVerticalAlign(VerticalAlign.MIDDLE); Style titleStyle = new Style(); titleStyle.setFont(new Font(18, Font._FONT_VERDANA, true)); Style importeStyle = new Style(); importeStyle.setHorizontalAlign(HorizontalAlign.RIGHT); Style oddRowStyle = new Style(); oddRowStyle.setBorder(Border.NO_BORDER); oddRowStyle.setBackgroundColor(Color.LIGHT_GRAY);
Vector routeLayer = new Vector("route"); List<Point> pointList = new ArrayList<Point>(); Projection defaultProj = new Projection(DEFAULT_PROJECTION); // DEFAULT_PROJECTION = "EPSG:4326" Projection mapProj = new Projection(mapWidget.getMap().getProjection()); for (String coord : KML.split(" ")) { String[] xyz = coord.split(","); if (xyz.length == 3) { Point point = new Point(Double.parseDouble(xyz[0]), Double.parseDouble(xyz[1])); // lon,lat point.transform(defaultProj, mapProj); pointList.add(point); } } LineString geometry = new LineString(pointList.toArray(new Point[pointList.size()])); Style style = new Style(); style.setStrokeColor("#0033ff"); style.setStrokeWidth(5); routeLayer.addFeature(new VectorFeature(geometry, style)); mapWidget.getMap().addLayer(routeLayer);
private void generateTable(final MyCSS hcCss) { Table table = new Table(null, new CustomAttribute("cellspacing", "0"), new CustomAttribute("cellpadding", "3")) {{ new TBody(this) {{ new Tr(this) {{ new Td(this, new Style("padding: 3px")) {{ new NoTag(this, "XXXX"); }}; }}; }}; }}; System.out.println(table.toHtmlString()); }
Style mainDivStyle = new Style(); mainDivStyle.addCssProperties(AlignItems.CENTER, new BackgroundColor( CssColorName.AQUA.getColorName())); Html html = new Html(null) { Body body = new Body(this) { Div mainDiv = new Div(this, mainDivStyle); Footer footer = new Footer(this); }; }; try { //to write to a file html.toOutputStream(new FileOutputStream("/home/ansgar/html_work/html-by-wffweb.html")); //to print in to console //System.out.println(html.toHtmlString()); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
Style mainDivStyle = new Style(); mainDivStyle.addCssProperties(AlignItems.CENTER, new BackgroundColor( CssColorName.AQUA.getColorName())); Html html = new Html(null) { Body body = new Body(this) { Div mainDiv = new Div(this, mainDivStyle); Footer footer = new Footer(this); }; }; try { //to write to a file html.toOutputStream(new FileOutputStream("/home/ansgar/html_work/html-by-wffweb.html")); //to print in to console //System.out.println(html.toHtmlString()); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
Style style = new Style(); style.setHorizontalAlign(HorizontalAlign.CENTER);
Style style = new Style(); style.setHorizontalAlignment(TextAlignmentType.LEFT); style.setTextWrapped(true);
Body body = new Body(this, new Style(new BackgroundColor(CssColorName.LIGHT_CYAN.getColorName()))) { Table table = new Table(this) {
/** * Creates the style. * * @return the style */ private Style createStyle() { Style style = new Style(); style.setStrokeColor("#000000"); style.setStrokeWidth(1); style.setFillColor("#FF0000"); style.setFillOpacity(0.5); style.setPointRadius(5); style.setStrokeOpacity(1.0); return style; }
new ListItem( new Style().withMargin(new QuadLength(new Length(5))), "Item 3 (margin: 5pt)" ), new ListItem( new Style() .withBackground(new Background(new DeviceRGBColor(252f/255, 232f/255, 131f/255))) .withBorder(new Border( new Style().withListStyle(new ListStyle(ListStyleTypeEnum.Circle)), new ListItem("Sublist Item 1"), new ListItem( new Style().withListStyle(new ListStyle(new char[]{0312, 0313, 0314, 0315, 0316, 0317, 0320, 0321, 0322})), new ListItem("Sub-sublist Item 1"), new ListItem("Sub-sublist Item 2"), new Style().withListStyle(new ListStyle(ListStyleTypeEnum.Decimal)), new ListItem("Sub-sublist Item 1"), new ListItem( new Style().withListStyle(new ListStyle(ListStyleTypeEnum.LowerLatin)), new ListItem("Sub-sub-sublist Item 1"), new ListItem("Sub-sub-sublist Item 2"),
//Create a style. We want a blue dashed line. final Style drawStyle = new Style(); //create a Style to use drawStyle.setFillColor("white"); drawStyle.setGraphicName("x"); drawStyle.setPointRadius(4); drawStyle.setStrokeWidth(3); drawStyle.setStrokeColor("#66FFFF"); drawStyle.setStrokeDashstyle("dash"); //create a StyleMap using the Style StyleMap drawStyleMap = new StyleMap(drawStyle); //Create PathHanlderOptions using this StyleMap PathHandlerOptions phOpt = new PathHandlerOptions(); phOpt.setStyleMap(drawStyleMap); //Create DrawFeatureOptions and set the PathHandlerOptions (that have the StyleMap, that have the Style we wish) DrawFeatureOptions drawFeatureOptions = new DrawFeatureOptions(); drawFeatureOptions.setHandlerOptions(phOpt); PathHandler pathHanlder = new PathHandler(); // Create the DrawFeature control to draw on the map, and pass the DrawFeatureOptions to control the style of the sketch final DrawFeature drawLine = new DrawFeature(vectorLayer, pathHanlder, drawFeatureOptions); map.addControl(drawLine); drawLine.activate();