List of usage examples for java.lang Float Float
@Deprecated(since = "9") public Float(String s) throws NumberFormatException
From source file:com.medigy.persist.model.invoice.TestInvoice.java
public void testInvoice() { Session session = openSession();// w w w. j ava 2 s.c om final Transaction transaction = session.beginTransaction(); final Invoice invoice = new Invoice(); invoice.setDescription("New invoice"); invoice.addInvoiceAttribute("Attribute 1", (long) 123); invoice.addInvoiceAttribute("Attribute 2", "hello world"); final InvoiceTermType termType = new InvoiceTermType(); termType.setCode("PAYMENT"); termType.setLabel("Payment - net days"); termType.setParty(Party.Cache.SYS_GLOBAL_PARTY.getEntity()); session.save(termType); final InvoiceTerm term = new InvoiceTerm(); term.setInvoice(invoice); term.setType(termType); term.setTermValue(new Long(30)); invoice.getInvoiceTerms().add(term); session.save(invoice); Calendar cal = new GregorianCalendar(); cal.set(2005, 1, 5); final InvoiceStatus status = new InvoiceStatus(); status.setType(InvoiceStatusType.Cache.ON_HOLD.getEntity()); status.setInvoiceStatusDate(cal.getTime()); invoice.addInvoiceStatus(status); cal.set(2005, 1, 1); final InvoiceStatus newStatus = new InvoiceStatus(); newStatus.setType(InvoiceStatusType.Cache.CREATED.getEntity()); newStatus.setInvoiceStatusDate(cal.getTime()); invoice.addInvoiceStatus(newStatus); cal.set(2005, 1, 11); final InvoiceStatus voidStatus = new InvoiceStatus(); voidStatus.setType(InvoiceStatusType.Cache.VOID.getEntity()); voidStatus.setInvoiceStatusDate(cal.getTime()); invoice.addInvoiceStatus(voidStatus); final InvoiceItem item1 = new InvoiceItem(); item1.setAmount(new Float(100.50)); invoice.addInvoiceItem(item1); final InvoiceItem item2 = new InvoiceItem(); item2.setAmount(new Float(200.00)); invoice.addInvoiceItem(item2); session.update(invoice); transaction.commit(); session.close(); session = openSession(); final Long invoiceId = invoice.getInvoiceId(); Invoice savedInvoice = (Invoice) session.createCriteria(Invoice.class) .add(Restrictions.eq("invoiceId", invoiceId)).uniqueResult(); assertEquals(1, savedInvoice.getInvoiceTerms().size()); InvoiceTerm savedInvoiceTerm = (InvoiceTerm) savedInvoice.getInvoiceTerms().toArray()[0]; assertEquals(savedInvoiceTerm.getTermValue(), new Long(30)); assertEquals("New invoice", savedInvoice.getDescription()); log.info("VALID: Invoice"); assertEquals(3, savedInvoice.getInvoiceStatuses().size()); log.info("VALID: Invoice status count"); assertEquals(savedInvoice.getInvoiceStatuses().get(0).getType().getInvoiceStatusTypeId(), InvoiceStatusType.Cache.VOID.getEntity().getInvoiceStatusTypeId()); assertEquals(savedInvoice.getInvoiceStatuses().get(2).getType().getInvoiceStatusTypeId(), InvoiceStatusType.Cache.CREATED.getEntity().getInvoiceStatusTypeId()); assertEquals(voidStatus.getInvoiceStatusId(), savedInvoice.getCurrentInvoiceStatus().getInvoiceStatusId()); assertEquals(savedInvoice.getCurrentInvoiceStatus().getType(), InvoiceStatusType.Cache.VOID.getEntity()); log.info("VALID: Current Invoice status type"); assertEquals(1, savedInvoice.getInvoiceTerms().size()); log.info("VALID: Invoice term count"); assertEquals(((InvoiceTerm) savedInvoice.getInvoiceTerms().toArray()[0]).getType(), termType); log.info("VALID: Invoice term type"); session.close(); }
From source file:com.yahoo.egads.utilities.GUIUtils.java
/** * Compute the time-series of anomalies. *///from w w w.j av a2 s. c o m public void addAnomalyTS(CombinedDomainXYPlot plot, DataSequence observedSeries, DataSequence expectedSeries) { // Compute the time-series of errors. HashMap<String, ArrayList<Float>> allErrors = aes.initAnomalyErrors(observedSeries, expectedSeries); Float sDAutoSensitivity = (float) 0.0; Float amntAutoSensitivity = (float) 0.0; if (config.getProperty("AUTO_SENSITIVITY_ANOMALY_PCNT") != null) { amntAutoSensitivity = new Float(config.getProperty("AUTO_SENSITIVITY_ANOMALY_PCNT")); } if (config.getProperty("AUTO_SENSITIVITY_SD") != null) { sDAutoSensitivity = new Float(config.getProperty("AUTO_SENSITIVITY_SD")); } String errorDebug = ""; for (int i = 0; i < (aes.getIndexToError().keySet()).size(); i++) { Float[] fArray = (allErrors.get(aes.getIndexToError().get(i))) .toArray(new Float[(allErrors.get(aes.getIndexToError().get(i))).size()]); XYDataset data1 = createDataset(fArray, aes.getIndexToError().get(i)); XYItemRenderer renderer1 = new StandardXYItemRenderer(); NumberAxis rangeAxis1 = new NumberAxis(aes.getIndexToError().get(i)); XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1); // Get threshold. Float d = AutoSensitivity.getLowDensitySensitivity(fArray, sDAutoSensitivity, amntAutoSensitivity); subplot1.addRangeMarker(new ValueMarker(d)); subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT); plot.add(subplot1, 1); errorDebug += aes.getIndexToError().get(i) + ": " + d + " "; } System.out.println(errorDebug); }
From source file:ejportal.webapp.action.BestellerAction.java
/** * Save.//from w w w . j a va 2 s .c o m * * @return the string * @throws Exception * the exception */ public String save() throws Exception { if (this.cancel != null) return BaseAction.CANCEL; if (this.delete != null) return this.delete(); final boolean isNew = (this.bestellerBaseTO.getBestellerId() == null); // Validierung Name if (this.bestellerBaseTO.getBestellerName().equals("")) { this.saveMessage(this.getText("Bitte geben Sie einen Namen ein.")); return "back"; } // Validierung Projekt if (this.bestellerBaseTO.getProjekt().equals("")) { this.saveMessage(this.getText("Bitte geben Sie ein Projekt ein.")); return "back"; } // Validierung Einzahlung erwnscht if (this.bestellerBaseTO.getEinzahlungErwuenscht() < 0) { this.saveMessage(this.getText("Bitte geben Sie einen Betrag ein.")); return "back"; } if (!(new Float(this.bestellerBaseTO.getEinzahlungErwuenscht()) instanceof Float)) { this.saveMessage(this.getText("Bitte geben Sie eine Zahl ein.")); return "back"; } // Validierung Einzahlung festgelegt if (this.bestellerBaseTO.getEinzahlungFestgelegt() < 0) { this.saveMessage(this.getText("Bitte geben Sie einen Betrag ein.")); return "back"; } if (!(new Float(this.bestellerBaseTO.getEinzahlungFestgelegt()) instanceof Float)) { this.saveMessage(this.getText("Bitte geben Sie eine Zahl ein.")); return "back"; } if (isNew) { this.besteller = this.bestellerManager.create(this.bestellerBaseTO); this.bestellerId = this.besteller.getBestellerId(); } else { this.besteller = this.bestellerManager.saveBaseTO(this.bestellerBaseTO); this.bestellerId = this.besteller.getBestellerId(); } final String key = (isNew) ? "Besteller wurde erfolgreich erstellt." : "Besteller wurde erfolgreich aktualisiert."; this.saveMessage(key); return Action.SUCCESS; }
From source file:com.gwac.service.Ot2CheckServiceImpl.java
void searchOT2(OtLevel2 ot2) { if (ot2.getRa() < 0 || ot2.getRa() > 360 || ot2.getDec() < -90 || ot2.getDec() > 90) { return;/*from w w w .j av a 2 s . c o m*/ } log.debug("search ot2: " + ot2.getName()); Boolean flag = false; Map<Cvs, Double> tcvsm = matchOt2InCvs(ot2, cvsSearchbox, cvsMag); for (Map.Entry<Cvs, Double> entry : tcvsm.entrySet()) { Cvs tcvs = (Cvs) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = mtDao.getMatchTableByTypeName("cvs"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(tcvs.getIdnum())); ot2m.setRa(tcvs.getRadeg()); ot2m.setDec(tcvs.getDedeg()); ot2m.setMag(tcvs.getMag()); ot2m.setDistance(distance.floatValue()); ot2m.setD25(new Float(0)); ot2mDao.save(ot2m); String cvsInfo = tcvs.getCvsid() + " " + tcvs.getRadeg() + " " + tcvs.getDedeg() + " " + tcvs.getMag(); log.debug("cvsInfo: " + cvsInfo); flag = true; } if (tcvsm.size() > 0) { ot2.setCvsMatch((short) tcvsm.size()); ot2Dao.updateCvsMatch(ot2); log.debug(ot2.getName() + " cvs :" + tcvsm.size()); } Map<MergedOther, Double> tmom = matchOt2InMergedOther(ot2, mergedSearchbox, mergedMag); for (Map.Entry<MergedOther, Double> entry : tmom.entrySet()) { MergedOther tmo = (MergedOther) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = getMtDao().getMatchTableByTypeName("merged_other"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(tmo.getIdnum())); ot2m.setRa(tmo.getRadeg()); ot2m.setDec(tmo.getDedeg()); ot2m.setMag(tmo.getMag()); ot2m.setDistance(distance.floatValue()); ot2m.setD25(new Float(0)); ot2mDao.save(ot2m); String moInfo = tmo.getIdnum() + " " + tmo.getRadeg() + " " + tmo.getDedeg() + " " + tmo.getMag(); log.debug("moInfo: " + moInfo); flag = true; } if (tmom.size() > 0) { ot2.setOtherMatch((short) tmom.size()); ot2Dao.updateOtherMatch(ot2); log.debug(ot2.getName() + " other :" + tmom.size()); } Map<Rc3, Double> trc3m = matchOt2InRc3(ot2, rc3Searchbox, rc3MinMag, rc3MaxMag); for (Map.Entry<Rc3, Double> entry : trc3m.entrySet()) { Rc3 trc3 = (Rc3) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = getMtDao().getMatchTableByTypeName("rc3"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(trc3.getIdnum())); ot2m.setRa(trc3.getRadeg()); ot2m.setDec(trc3.getDedeg()); ot2m.setMag(trc3.getMvmag()); ot2m.setDistance(distance.floatValue()); ot2m.setD25(trc3.getD25()); ot2mDao.save(ot2m); String moInfo = trc3.getIdnum() + " " + trc3.getRadeg() + " " + trc3.getDedeg() + " " + trc3.getMvmag(); log.debug("rc3Info: " + moInfo); flag = true; } if (trc3m.size() > 0) { ot2.setRc3Match((short) trc3m.size()); ot2Dao.updateRc3Match(ot2); log.debug(ot2.getName() + " rc3 :" + trc3m.size()); } Map<MinorPlanet, Double> tmpm = matchOt2InMinorPlanet(ot2, minorPlanetSearchbox, minorPlanetMag);//minorPlanetSearchbox for (Map.Entry<MinorPlanet, Double> entry : tmpm.entrySet()) { MinorPlanet tmp = (MinorPlanet) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = getMtDao().getMatchTableByTypeName("minor_planet"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(tmp.getIdnum())); ot2m.setRa(tmp.getLon()); ot2m.setDec(tmp.getLat()); ot2m.setMag(tmp.getVmag()); ot2m.setDistance(distance.floatValue()); ot2m.setD25(new Float(0)); ot2mDao.save(ot2m); String moInfo = tmp.getIdnum() + " " + tmp.getMpid() + " " + tmp.getLon() + " " + tmp.getLat(); log.debug("moInfo: " + moInfo); flag = true; } if (tmpm.size() > 0) { ot2.setMinorPlanetMatch((short) tmpm.size()); ot2Dao.updateMinorPlanetMatch(ot2); log.debug(ot2.getName() + " minor planet :" + tmpm.size()); } long startTime = System.nanoTime(); Map<OtLevel2, Double> tOT2Hism = matchOt2His(ot2, ot2Searchbox, 0); Boolean hisType = false; for (Map.Entry<OtLevel2, Double> entry : tOT2Hism.entrySet()) { OtLevel2 tot2 = (OtLevel2) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = getMtDao().getMatchTableByTypeName("ot_level2_his"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(tot2.getOtId())); ot2m.setRa(tot2.getRa()); ot2m.setDec(tot2.getDec()); ot2m.setMag(tot2.getMag()); ot2m.setDistance(distance.floatValue()); ot2mDao.save(ot2m); flag = true; if (!hisType && tot2.getOtType() != null && ((tot2.getOtType() >= 8 && tot2.getOtType() <= 11) || tot2.getOtType() == 15)) { ot2.setOtType(tot2.getOtType()); ot2Dao.updateOTType(ot2); hisType = true; } } if (tOT2Hism.size() > 0) { ot2.setOt2HisMatch((short) tOT2Hism.size()); ot2Dao.updateOt2HisMatch(ot2); log.debug(ot2.getName() + " ot2his :" + tOT2Hism.size()); } long endTime = System.nanoTime(); log.debug("search ot2 history consume " + 1.0 * (endTime - startTime) / 1e9 + " seconds."); if (ot2.getDataProduceMethod() == '8') { startTime = System.nanoTime(); Map<UsnoCatalog, Double> tusno = matchOt2InUsnoCatalog2(ot2);//minorPlanetSearchbox // log.debug("ot2: " + ot2.getName()); // log.debug("usnoMag: " + usnoMag); // log.debug("usno match size: " + tusno.size()); for (Map.Entry<UsnoCatalog, Double> entry : tusno.entrySet()) { UsnoCatalog tmp = (UsnoCatalog) entry.getKey(); Double distance = (Double) entry.getValue(); MatchTable ott = getMtDao().getMatchTableByTypeName("usno"); OtLevel2Match ot2m = new OtLevel2Match(); ot2m.setOtId(ot2.getOtId()); ot2m.setMtId(ott.getMtId()); ot2m.setMatchId(Long.valueOf(tmp.getRcdid())); ot2m.setRa(tmp.getrAdeg()); ot2m.setDec(tmp.getdEdeg()); ot2m.setMag(tmp.getRmag()); ot2m.setDistance(distance.floatValue()); ot2m.setD25(new Float(0)); ot2mDao.save(ot2m); flag = true; } if (tusno.size() > 0) { ot2.setUsnoMatch((short) tusno.size()); ot2Dao.updateUsnoMatch(ot2); log.debug(ot2.getName() + " usno :" + tusno.size()); } endTime = System.nanoTime(); log.debug("search usno table consume " + 1.0 * (endTime - startTime) / 1e9 + " seconds."); } try { boolean tflag = filtOT2InCcdPixel(ot2); if (tflag) { flag = tflag; } } catch (Exception e) { log.error("filt ot2 " + ot2.getName() + " in ccd pixel error!", e); } if (flag) { ot2.setIsMatch((short) 2); ot2Dao.updateIsMatch(ot2); } else {//??? ot2.setIsMatch((short) 1); ot2Dao.updateIsMatch(ot2); } }
From source file:de.avanux.livetracker.statistics.TrackingStatistics.java
public float getAvgLocationMessagePeriod() { Duration duration = getDuration(); if (duration != null) { return new Float(duration.getStandardSeconds()).floatValue() / new Float(this.locationMessagesCount - 1).floatValue(); } else {//w w w . j a v a 2s . c om return 0; } }
From source file:com.jaspersoft.studio.components.chart.editor.wizard.BaseSettingsFactory.java
/** * *//*from w w w . j a v a 2 s . c o m*/ public static final ChartThemeSettings createChartThemeSettings() { ChartThemeSettings settings = new ChartThemeSettings(); ChartSettings chartSettings = settings.getChartSettings(); chartSettings.setBackgroundPaint(new GradientPaintProvider(CHART_BACKGROUND1, CHART_BACKGROUND2)); chartSettings.setBackgroundImage( new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png")); chartSettings.setBackgroundImageAlignment(new Integer(Align.TOP_RIGHT)); chartSettings.setBackgroundImageAlpha(new Float(1f)); chartSettings.setBorderVisible(Boolean.FALSE); chartSettings.setBorderPaint(new ColorProvider(Color.BLACK)); chartSettings.setBorderStroke(new BasicStroke(1f)); chartSettings.setAntiAlias(Boolean.TRUE); chartSettings.setTextAntiAlias(Boolean.TRUE); chartSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4)); TitleSettings titleSettings = settings.getTitleSettings(); titleSettings.setShowTitle(Boolean.TRUE); titleSettings.setPosition(EdgeEnum.TOP); titleSettings.setForegroundPaint(new ColorProvider(Color.black)); titleSettings.setBackgroundPaint(new ColorProvider(TITLE_BACKGROUND)); titleSettings.getFont().setBold(Boolean.TRUE); titleSettings.getFont().setFontSize(22); titleSettings.setHorizontalAlignment(HorizontalAlignment.CENTER); titleSettings.setVerticalAlignment(VerticalAlignment.TOP); titleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4)); TitleSettings subtitleSettings = settings.getSubtitleSettings(); subtitleSettings.setShowTitle(Boolean.TRUE); subtitleSettings.setPosition(EdgeEnum.TOP); subtitleSettings.setForegroundPaint(new ColorProvider(Color.BLACK)); subtitleSettings.setBackgroundPaint(new ColorProvider(SUBTITLE_BACKGROUND)); subtitleSettings.getFont().setBold(Boolean.TRUE); subtitleSettings.setHorizontalAlignment(HorizontalAlignment.CENTER); subtitleSettings.setVerticalAlignment(VerticalAlignment.TOP); subtitleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4)); LegendSettings legendSettings = settings.getLegendSettings(); legendSettings.setShowLegend(Boolean.TRUE); legendSettings.setPosition(EdgeEnum.BOTTOM); legendSettings.setForegroundPaint(new ColorProvider(Color.black)); legendSettings.setBackgroundPaint(new ColorProvider(Color.white)); legendSettings.getFont().setBold(Boolean.TRUE); legendSettings.getFont().setFontSize(7); legendSettings.setHorizontalAlignment(HorizontalAlignment.CENTER); legendSettings.setVerticalAlignment(VerticalAlignment.BOTTOM); //FIXMETHEME legendSettings.setBlockFrame(); legendSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4)); PlotSettings plotSettings = settings.getPlotSettings(); plotSettings.setOrientation(PlotOrientation.VERTICAL); // plotSettings.setForegroundAlpha(new Float(0.5f)); plotSettings.setBackgroundPaint(new ColorProvider(Color.white)); plotSettings.setBackgroundAlpha(new Float(0.0f)); plotSettings.setBackgroundImage( new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png")); plotSettings.setBackgroundImageAlpha(new Float(0.5f)); plotSettings.setBackgroundImageAlignment(new Integer(Align.NORTH_WEST)); plotSettings.setLabelRotation(new Double(0)); plotSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4)); plotSettings.setOutlineVisible(Boolean.TRUE); plotSettings.setOutlinePaint(new ColorProvider(Color.BLACK)); plotSettings.setOutlineStroke(new BasicStroke(1f)); plotSettings.setSeriesColorSequence(COLORS); // plotSettings.setSeriesGradientPaintSequence(GRADIENT_PAINTS); plotSettings.setSeriesOutlinePaintSequence(COLORS_DARKER); plotSettings.setSeriesStrokeSequence(STROKES); plotSettings.setSeriesOutlineStrokeSequence(OUTLINE_STROKES); plotSettings.setDomainGridlineVisible(Boolean.TRUE); plotSettings.setDomainGridlinePaint(new ColorProvider(Color.BLACK)); plotSettings.setDomainGridlineStroke(new BasicStroke(0.5f)); plotSettings.setRangeGridlineVisible(Boolean.TRUE); plotSettings.setRangeGridlinePaint(new ColorProvider(Color.BLACK)); plotSettings.setRangeGridlineStroke(new BasicStroke(0.5f)); plotSettings.getTickLabelFont().setFontName("Arial"); plotSettings.getTickLabelFont().setBold(Boolean.TRUE); plotSettings.getTickLabelFont().setFontSize(10); plotSettings.getDisplayFont().setFontName("Arial"); plotSettings.getDisplayFont().setBold(Boolean.TRUE); plotSettings.getDisplayFont().setFontSize(12); AxisSettings domainAxisSettings = settings.getDomainAxisSettings(); domainAxisSettings.setVisible(Boolean.TRUE); domainAxisSettings.setLocation(AxisLocation.BOTTOM_OR_RIGHT); domainAxisSettings.setLinePaint(new ColorProvider(Color.white)); domainAxisSettings.setLineStroke(new BasicStroke(1f)); domainAxisSettings.setLineVisible(Boolean.TRUE); // domainAxisSettings.setLabel("Domain Axis"); domainAxisSettings.setLabelAngle(new Double(0.0)); domainAxisSettings.setLabelPaint(new ColorProvider(Color.black)); domainAxisSettings.getLabelFont().setBold(Boolean.TRUE); domainAxisSettings.getLabelFont().setItalic(Boolean.FALSE); domainAxisSettings.getLabelFont().setFontName("Times New Roman"); domainAxisSettings.getLabelFont().setFontSize(10); domainAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1)); domainAxisSettings.setLabelVisible(Boolean.TRUE); domainAxisSettings.setTickLabelPaint(new ColorProvider(Color.cyan)); domainAxisSettings.getTickLabelFont().setBold(Boolean.TRUE); domainAxisSettings.getTickLabelFont().setItalic(Boolean.FALSE); domainAxisSettings.getTickLabelFont().setFontName("Times New Roman"); domainAxisSettings.getTickLabelFont().setFontSize(7); domainAxisSettings.getTickLabelFont().setItalic(Boolean.TRUE); domainAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5)); domainAxisSettings.setTickLabelsVisible(Boolean.TRUE); domainAxisSettings.setTickMarksInsideLength(new Float(0.1f)); domainAxisSettings.setTickMarksOutsideLength(new Float(0.2f)); domainAxisSettings.setTickMarksPaint(new ColorProvider(Color.black)); domainAxisSettings.setTickMarksStroke(new BasicStroke(1f)); domainAxisSettings.setTickMarksVisible(Boolean.TRUE); domainAxisSettings.setTickCount(new Integer(5)); AxisSettings rangeAxisSettings = settings.getRangeAxisSettings(); rangeAxisSettings.setVisible(Boolean.TRUE); rangeAxisSettings.setLocation(AxisLocation.TOP_OR_RIGHT); rangeAxisSettings.setLinePaint(new ColorProvider(Color.white)); rangeAxisSettings.setLineStroke(new BasicStroke(1f)); rangeAxisSettings.setLineVisible(Boolean.TRUE); // rangeAxisSettings.setLabel("Range Axis"); rangeAxisSettings.setLabelAngle(new Double(Math.PI / 2.0)); rangeAxisSettings.setLabelPaint(new ColorProvider(Color.black)); rangeAxisSettings.getLabelFont().setBold(Boolean.TRUE); rangeAxisSettings.getLabelFont().setItalic(Boolean.FALSE); rangeAxisSettings.getLabelFont().setFontName("Times New Roman"); rangeAxisSettings.getLabelFont().setFontSize(10); rangeAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1)); rangeAxisSettings.setLabelVisible(Boolean.TRUE); rangeAxisSettings.setTickLabelPaint(new ColorProvider(Color.pink)); rangeAxisSettings.getTickLabelFont().setBold(Boolean.FALSE); rangeAxisSettings.getTickLabelFont().setItalic(Boolean.FALSE); rangeAxisSettings.getTickLabelFont().setFontName("Times New Roman"); rangeAxisSettings.getTickLabelFont().setFontSize(7); rangeAxisSettings.getTickLabelFont().setItalic(Boolean.TRUE); rangeAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5)); rangeAxisSettings.setTickLabelsVisible(Boolean.TRUE); rangeAxisSettings.setTickMarksInsideLength(new Float(0.2f)); rangeAxisSettings.setTickMarksOutsideLength(new Float(0.1f)); rangeAxisSettings.setTickMarksPaint(new ColorProvider(Color.black)); rangeAxisSettings.setTickMarksStroke(new BasicStroke(1f)); rangeAxisSettings.setTickMarksVisible(Boolean.TRUE); rangeAxisSettings.setTickCount(new Integer(6)); return settings; }
From source file:lcmc.LCMC.java
/** Create the GUI and show it. */ protected static void createAndShowGUI(final Container mainFrame) { final java.util.List<Object> buttonGradient = Arrays.asList(new Object[] { new Float(.3f), new Float(0f), new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND), new ColorUIResource(0xFFFFFF), new ColorUIResource(ClusterBrowser.BUTTON_PANEL_BACKGROUND) }); final java.util.List<Object> checkboxGradient = Arrays.asList( new Object[] { new Float(.3f), new Float(0f), new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND), new ColorUIResource(ClusterBrowser.PANEL_BACKGROUND), new ColorUIResource(0xFFFFFF) }); ToolTipManager.sharedInstance().setInitialDelay(TOOLTIP_INITIAL_DELAY); ToolTipManager.sharedInstance().setDismissDelay(TOOLTIP_DISMISS_DELAY); UIManager.put("TableHeader.background", Tools.getDefaultColor("DrbdMC.TableHeader")); UIManager.put("TableHeader.font", UIManager.getFont("Label.font")); UIManager.put("Button.gradient", buttonGradient); UIManager.put("Button.select", ClusterBrowser.PANEL_BACKGROUND); UIManager.put("CheckBox.gradient", checkboxGradient); UIManager.put("CheckBoxMenuItem.gradient", checkboxGradient); UIManager.put("RadioButton.gradient", checkboxGradient); UIManager.put("RadioButton.rollover", Boolean.TRUE); UIManager.put("RadioButtonMenuItem.gradient", checkboxGradient); UIManager.put("ScrollBar.gradient", buttonGradient); UIManager.put("ToggleButton.gradient", buttonGradient); UIManager.put("Menu.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND); UIManager.put("MenuItem.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND); UIManager.put("List.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND); UIManager.put("ComboBox.selectionBackground", ClusterBrowser.BUTTON_PANEL_BACKGROUND); UIManager.put("OptionPane.background", ClusterBrowser.BUTTON_PANEL_BACKGROUND); UIManager.put("Panel.background", ClusterBrowser.PANEL_BACKGROUND); /* Create and set up the window. */ Tools.getGUIData().setMainFrame(mainFrame); /* Display the window. */ mainFrame.setSize(Tools.getDefaultInt("DrbdMC.width"), Tools.getDefaultInt("DrbdMC.height")); mainFrame.setVisible(true);/*w w w. j a va 2 s . co m*/ }
From source file:fr.in2p3.cc.storage.treqs.persistence.mock.dao.MockConfigurationDAO.java
/** * Drive distribution per user.//from ww w .j av a 2 s .c o m * <p> * <code> * id type...user1 user2 user3 user4 user5 user6 user7<br/> * 1. T10K-A . 2 ... 1 ... 1 ... - ... - ... 2 ... 3<br/> * 2. T10K-B . 3 ... 2 ... - ... 1 ... - ... - ... 1<br/> * 3. T10K-C . - ... - ... - ... - ... 1 ... 1 ... 2 * </code> * * @see fr.in2p3.cc.storage.treqs.model.dao.ConfigurationDAO# * getResourceAllocation() * @return Allocation per mock users. * @throws AbstractPersistanceException * Never. */ @Override public MultiMap getResourceAllocation() throws AbstractPersistanceException { LOGGER.trace("> getResourceAllocation"); if (exception != null) { final AbstractPersistanceException toThrow = exception; exception = null; throw toThrow; } final MultiMap values = new MultiValueMap(); // T10KA values.put(new Float(MockConfigurationDAO.DOT_ONE), new PersistenceHelperResourceAllocation("user1", 2)); values.put(new Float(MockConfigurationDAO.DOT_ONE), new PersistenceHelperResourceAllocation("user2", 1)); values.put(new Float(MockConfigurationDAO.DOT_ONE), new PersistenceHelperResourceAllocation("user3", 1)); // No user4 // No user5 values.put(new Float(MockConfigurationDAO.DOT_ONE), new PersistenceHelperResourceAllocation("user6", 2)); values.put(new Float(MockConfigurationDAO.DOT_ONE), new PersistenceHelperResourceAllocation("user7", 3)); // T10KB values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user1", 3)); values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user2", 2)); // No user3 values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user4", 1)); // No user5 // No user6 values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user7", 3)); // T10KC // No user1 // No user2 // No user3 // No user4 values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user5", 1)); values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user6", 1)); values.put(new Float(MockConfigurationDAO.DOT_TWO), new PersistenceHelperResourceAllocation("user6", 2)); LOGGER.trace("< getResourceAllocation"); return values; }
From source file:de.javakaffee.web.msm.serializer.javolution.AaltoTranscoderTest.java
@DataProvider(name = "typesAsSessionAttributesProvider") protected Object[][] createTypesAsSessionAttributesData() { return new Object[][] { { int.class, 42 }, { long.class, 42 }, { Boolean.class, Boolean.TRUE }, { String.class, "42" }, { Class.class, String.class }, { Long.class, new Long(42) }, { Integer.class, new Integer(42) }, { Character.class, new Character('c') }, { Byte.class, new Byte("b".getBytes()[0]) }, { Double.class, new Double(42d) }, { Float.class, new Float(42f) }, { Short.class, new Short((short) 42) }, { BigDecimal.class, new BigDecimal(42) }, { AtomicInteger.class, new AtomicInteger(42) }, { AtomicLong.class, new AtomicLong(42) }, { MutableInt.class, new MutableInt(42) }, { Integer[].class, new Integer[] { 42 } }, { Date.class, new Date(System.currentTimeMillis() - 10000) }, { Calendar.class, Calendar.getInstance() }, { ArrayList.class, new ArrayList<String>(Arrays.asList("foo")) }, { int[].class, new int[] { 1, 2 } }, { long[].class, new long[] { 1, 2 } }, { short[].class, new short[] { 1, 2 } }, { float[].class, new float[] { 1, 2 } }, { double[].class, new double[] { 1, 2 } }, { boolean[].class, new boolean[] { true, false } }, { byte[].class, "42".getBytes() }, { char[].class, "42".toCharArray() }, { String[].class, new String[] { "23", "42" } }, { Person[].class, new Person[] { createPerson("foo bar", Gender.MALE, 42) } } }; }
From source file:com.ibuildapp.romanblack.FanWallPlugin.data.JSONParser.java
/** * Downloads and parses JSON comments data. * * @param url URL resource that contains JSON data * @return comments array// ww w .j ava 2s . com */ public static ArrayList<FanWallMessage> parseMessagesUrl(String url) { try { Log.e("URLTAG", url); String resp = loadURLData(url); if (resp == null) { return null; } if (resp.length() == 0) { return null; } JSONObject mainObject = new JSONObject(resp); JSONArray messagesJSON = mainObject.getJSONArray("posts"); ArrayList<FanWallMessage> parsedMessages = new ArrayList<FanWallMessage>(); for (int i = 0; i < messagesJSON.length(); i++) { JSONObject messageJSON = messagesJSON.getJSONObject(i); FanWallMessage tmpMessage = new FanWallMessage(); tmpMessage.setId(new Long(messageJSON.getString("post_id")).longValue()); tmpMessage.setAuthor(messageJSON.getString("user_name")); tmpMessage.setDate(new Date(new Long(messageJSON.getString("create")).longValue())); tmpMessage.setUserAvatarUrl(messageJSON.getString("user_avatar")); tmpMessage.setText(messageJSON.getString("text")); try { tmpMessage.setPoint(new Float(messageJSON.getString("latitude")).floatValue(), new Float(messageJSON.getString("longitude")).floatValue()); } catch (NumberFormatException nFEx) { Log.e("", ""); } try { tmpMessage.setParentId(new Integer(messageJSON.getString("parent_id")).intValue()); } catch (NumberFormatException nFEx) { Log.e("", ""); } try { tmpMessage.setReplyId(new Integer(messageJSON.getString("reply_id")).intValue()); } catch (NumberFormatException nFEx) { Log.e("", ""); } tmpMessage.setTotalComments(new Integer(messageJSON.getString("total_comments")).intValue()); JSONArray imagesJSON = messageJSON.getJSONArray("images"); if (imagesJSON.length() > 0) { tmpMessage.setImageUrl(imagesJSON.getString(0)); } tmpMessage.setAccountId(messageJSON.getString("account_id")); tmpMessage.setAccountType(messageJSON.getString("account_type")); parsedMessages.add(tmpMessage); } return parsedMessages; } catch (JSONException jSSONEx) { return null; } }