/** * 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; }
/** * Creates a StyleMap setting the same style for all renderer intents. * <p> * From OpenLayers documentation: If just one style hash or style object is * passed, this will be used for all known render intents (default, select, * temporary) */ public StyleMap(Style style) { this(StyleMapImpl.create(style.getJSObject(), style.getJSObject(), style.getJSObject())); }
/** Use getPointRadiusAsDouble() instead */ @Deprecated public double getPointRadius() { return getPointRadiusAsDouble(); }
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
//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();
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);
public static Style narrowToOpenLayersStyle(JSObject element) { return (element == null) ? null: new Style(element); } }
Style style = new Style(); style.setHorizontalAlignment(TextAlignmentType.LEFT); style.setTextWrapped(true); cell.setStyle(style);
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(); }
styles.add(new Style()); styles.get(0).getFont().setBold(true); styles.add(new Style()); styles.get(1).getFont().setBold(false); styles.add(new Style()); styles.get(2).getFont().setBold(true); styles.add(new Style()); styles.get(3).getFont().setBold(false); cell.characters(startIndex, valueLength).getFont().setBold(style.getFont().isBold());
Style style = new Style(); style.setHorizontalAlign(HorizontalAlign.CENTER);
Style style = new Style(); style.background = new BorderedSimpleBackground(0xF0F0F0, 0xFF0000, 1); item.setStyle(style);
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(); }
/** * Directly sets the StrokeLineCap string. Default is 'round'. [butt | round * | square] */ public void setStrokeLinecap(String strokeLinecap) { StyleImpl.setStrokeLinecap(this.getJSObject(), strokeLinecap); }
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);
/** Use getPointRadiusAsDouble() instead */ @Deprecated public double getPointRadius() { return getPointRadiusAsDouble(); }
/** * Named graphic to use when rendering points. Supported values include * 'circle' (default), 'square', 'star', 'x', 'cross', 'triangle'. */ public String getGraphicName() { return StyleImpl.getGraphicName(this.getJSObject()); }
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()); }
/** Fill opacity (0-1). */ public double getFillOpacity() { double o = StyleImpl.getFillOpacity(getJSObject()); return o; }