List of usage examples for java.awt Dimension getHeight
public double getHeight()
From source file:com.hp.autonomy.frontend.reports.powerpoint.PowerPointServiceImpl.java
/** * Convert provided anchor points from fractional units (0-1 range) to PowerPoint coordinates. * @param ppt the PowerPoint presentation to use. * @param anchor the anchor in fractional (0-1) units. * @return bounding rectangle in PowerPoint coordinates. */// ww w. j a v a 2 s .c o m private static Rectangle2D.Double createPageAnchor(final XMLSlideShow ppt, final Anchor anchor) { final Dimension pageSize = ppt.getPageSize(); final double availW = pageSize.getWidth(); final double availH = pageSize.getHeight(); return new Rectangle2D.Double(availW * anchor.getX(), availH * anchor.getY(), availW * anchor.getWidth(), availH * anchor.getHeight()); }
From source file:ome.io.nio.PixelsService.java
private PixelsPyramidMinMaxStore performWrite(final Pixels pixels, final File pixelsPyramidFile, final BfPyramidPixelBuffer pixelsPyramid, final File pixelsFile, final String pixelsFilePath, final String originalFilePath) { final PixelBuffer source; final Dimension tileSize; final PixelsPyramidMinMaxStore minMaxStore; if (pixelsFile.exists()) { minMaxStore = null;/*from w ww.ja va2 s .c om*/ source = createRomioPixelBuffer(pixelsFilePath, pixels, false); // FIXME: This should be configuration or service driven // FIXME: Also implemented in RenderingBean.getTileSize() tileSize = new Dimension(Math.min(pixels.getSizeX(), sizes.getTileWidth()), Math.min(pixels.getSizeY(), sizes.getTileHeight())); } else { minMaxStore = new PixelsPyramidMinMaxStore(pixels.getSizeC()); int series = getSeries(pixels); BfPixelBuffer bfPixelBuffer = createMinMaxBfPixelBuffer(originalFilePath, series, minMaxStore); pixelsPyramid .setByteOrder(bfPixelBuffer.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); source = bfPixelBuffer; // If the tile sizes we've been given are completely ridiculous // then reset them to WIDTHxHEIGHT. Currently these conditions are: // * TileWidth == ImageWidth // * TileHeight == ImageHeight // * Smallest tile dimension divided by the largest resolution // level factor is < 1. // -- Chris Allan (ome:#5224). final Dimension sourceTileSize = source.getTileSize(); final double tileWidth = sourceTileSize.getWidth(); final double tileHeight = sourceTileSize.getHeight(); final boolean tileDimensionTooSmall; double factor = Math.pow(2, 5); if (((tileWidth / factor) < 1.0) || ((tileHeight / factor) < 1.0)) { tileDimensionTooSmall = true; } else { tileDimensionTooSmall = false; } if (tileWidth == source.getSizeX() || tileHeight == source.getSizeY() || tileDimensionTooSmall) { tileSize = new Dimension(Math.min(pixels.getSizeX(), sizes.getTileWidth()), Math.min(pixels.getSizeY(), sizes.getTileHeight())); } else { tileSize = sourceTileSize; } } log.info("Destination pyramid tile size: " + tileSize); try { final double totalTiles = source.getSizeZ() * source.getSizeC() * source.getSizeT() * (Math.ceil(source.getSizeX() / tileSize.getWidth())) * (Math.ceil(source.getSizeY() / tileSize.getHeight())); final int tenPercent = Math.max((int) totalTiles / 10, 1); Utils.forEachTile(new TileLoopIteration() { public void run(int z, int c, int t, int x, int y, int w, int h, int tileCount) { if (log.isInfoEnabled() && tileCount % tenPercent == 0) { log.info(String.format("Pyramid creation for Pixels:%d %d/%d (%d%%).", pixels.getId(), tileCount + 1, (int) totalTiles, (int) (tileCount / totalTiles * 100))); } try { PixelData tile = source.getTile(z, c, t, x, y, w, h); pixelsPyramid.setTile(tile.getData().array(), z, c, t, x, y, w, h); } catch (IOException e1) { log.error("FAIL -- Error during tile population", e1); try { pixelsPyramidFile.delete(); FileUtils.touch(pixelsPyramidFile); // ticket:5189 } catch (Exception e2) { log.warn("Error clearing empty or incomplete pixel " + "buffer.", e2); } return; } } }, source, (int) tileSize.getWidth(), (int) tileSize.getHeight()); log.info("SUCCESS -- Pyramid created for pixels id:" + pixels.getId()); } finally { if (source != null) { try { source.close(); } catch (IOException e) { log.error("Error closing pixel pyramid.", e); } } } return minMaxStore; }
From source file:ome.services.RawPixelsBean.java
@RolesAllowed("user") public int[] getTileSize() { errorIfNotLoaded();//from w w w . j a v a2s . com Dimension tileSize = buffer.getTileSize(); return new int[] { (int) tileSize.getWidth(), (int) tileSize.getHeight() }; }
From source file:cool.pandora.modeller.ui.handlers.iiif.PatchResourceHandler.java
@Override public void execute() { final String message = ApplicationContextUtil.getMessage("bag.message.resourcepatched"); final DefaultBag bag = bagView.getBag(); final List<String> payload = bag.getPayloadPaths(); final Map<String, BagInfoField> map = bag.getInfo().getFieldMap(); final URI resourceContainer = IIIFObjectURI.getResourceContainerURI(map); final String basePath = AbstractBagConstants.DATA_DIRECTORY; final Path rootDir = bagView.getBagRootPath().toPath(); for (final String filePath : payload) { final String filename = BaggerFileEntity.removeBasePath(basePath, filePath); final String destinationURI = getDestinationURI(resourceContainer, filename); final Path absoluteFilePath = rootDir.resolve(filePath); final File resourceFile = absoluteFilePath.toFile(); String formatName = null; Dimension dim = null; InputStream rdfBody = null; final URI uri = URI.create(destinationURI); try {/* w ww . j av a 2 s . c o m*/ formatName = ImageIOUtil.getImageMIMEType(resourceFile); } catch (final Exception e) { e.printStackTrace(); } try { dim = ImageIOUtil.getImageDimensions(resourceFile); } catch (final Exception e) { e.printStackTrace(); } if (dim != null) { final double imgWidth = dim.getWidth(); final int iw = (int) imgWidth; final double imgHeight = dim.getHeight(); final int ih = (int) imgHeight; try { rdfBody = getResourceMetadata(map, filename, formatName, iw, ih); } catch (final Exception e) { e.printStackTrace(); } } try { ModellerClient.doPatch(uri, rdfBody); ApplicationContextUtil.addConsoleMessage(message + " " + destinationURI); } catch (final ModellerClientFailedException e) { ApplicationContextUtil.addConsoleMessage(getMessage(e)); } } bagView.getControl().invalidate(); }
From source file:inet.CalculationNetworkEditor.visual.view.EditorPane.java
public EditorPane(List<Graph<V, E>> phys, List<Graph<V, E>> virts, HashMap<V, V> stackVertex, HashMap<E, List<E>> stackEdge, HashMap<V, Double> vertexRessources, HashMap<E, Double> edgeRessources, Factory<V> pVertexFactory, Factory<E> pEdgeFactory, Dimension pActDimension) { super();/* w w w. j a v a 2s . com*/ actDimension = pActDimension; Dimension tabbedDimensions = new Dimension((int) pActDimension.getWidth() - 200, (int) pActDimension.getHeight()); setSize(pActDimension); setPreferredSize(pActDimension); setLayout(new BorderLayout()); vertexFactory = pVertexFactory; edgeFactory = pEdgeFactory; logic = new Logic<V, E>(); logic.init(phys, virts, stackVertex, stackEdge, vertexRessources, edgeRessources); tabbedPane = new JTabbedPane(); tabbedPane.setSize(tabbedDimensions); tabbedPane.setPreferredSize(tabbedDimensions); add(tabbedPane, BorderLayout.CENTER); rightBetweenPanel = new JPanel(); rightBetweenPanel.setLayout(new BorderLayout()); rightBetweenPanel.setSize(200, 500); rightBetweenPanel.setPreferredSize(new Dimension(200, 500)); add(rightBetweenPanel, BorderLayout.LINE_END); rightPanel = new JPanel(); rightPanel.setSize(200, 500); rightPanel.setPreferredSize(new Dimension(200, 500)); rightBetweenPanel.add(rightPanel, BorderLayout.CENTER); vertexPaintTransformer = new VertexPaintTransformer<V, E>(logic, tabbedPane); vertexPaintTransformerStacking = new VertexPaintTransformerStacking<V, E>(logic, tabbedPane); edgePaintTransformer = new EdgePaintTransformer<V, E>(logic, tabbedPane); edgeStrokeTransformer = new EdgeStrokeTransformer<V, E>(logic, tabbedPane); // init VisualisationViewer visViewPhysical = new VisualizationViewerPhysical<V, E>(logic.getDisplay(IStorage.Type.PHYSICAL), vertexPaintTransformer, edgePaintTransformer, edgeStrokeTransformer, this); visViewVirtual = new VisualizationViewerVirtual<V, E>(logic.getDisplay(IStorage.Type.VIRTUAL), vertexPaintTransformer, edgePaintTransformer, edgeStrokeTransformer, this); visViewBoth = new VisualizationViewerBoth<V, E>(logic.getDisplay(null), vertexPaintTransformer, vertexPaintTransformerStacking, edgePaintTransformer, edgeStrokeTransformer, this); vc = new ViewController<V, E>(this, visViewPhysical, visViewVirtual, visViewBoth); bc = new BackendController<V, E>(logic, pVertexFactory, pEdgeFactory); mouseAbstraction = new MouseAbstraction<V, E>(vc, bc, this); editingPanelsListener = new EditingPanelsListener<V, E>(this, bc); visViewPhysical.setMouseAbstraction(mouseAbstraction); visViewVirtual.setMouseAbstraction(mouseAbstraction); visViewBoth.setMouseAbstraction(mouseAbstraction); /* visViewPhysical.setGraphMouse(mgm); visViewVirtual.setGraphMouse(mgm); visViewBoth.setGraphMouse(mgm); */ vertexPaintTransformer.setVisualizationViewers(visViewPhysical, visViewVirtual, visViewBoth); vertexPaintTransformerStacking.setVisualizationViewers(visViewPhysical, visViewVirtual, visViewBoth); edgePaintTransformer.setVisualizationViewers(visViewPhysical, visViewVirtual, visViewBoth); /* deprecatedMML = new Controller( layoutPhysical, layoutVirtual, layoutBoth, visViewPhysical, visViewVirtual, visViewBoth, tabbedPane, logic, physGraph, virtGraph, vertexFactory, edgeFactory); //, // mousePhysical, mouseVirtual, mouseBoth); */ //visViewStateChangedListener = new VisualViewerStateChangedListener(visViewPhysical, visViewVirtual, visViewBoth); tabSwitchListener = new TabSwitchedListener(this, tabbedPane);//,deprecatedMML); reinitializeTabPane(); addComponentListener(new ComponentResizedListener(tabbedPane, this)); add(tabbedPane, BorderLayout.CENTER); //add(vv); }
From source file:io.bibleget.BibleGetHelp.java
/** * Creates new form BibleGetHelp/*w w w. java 2 s . c o m*/ */ private BibleGetHelp() throws ClassNotFoundException, UnsupportedEncodingException { //jTextPane does not initialize correctly, it causes a Null Exception Pointer //Following line keeps this from crashing the program Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); String packagePath = BibleGetIO.getPackagePath(); //String locale = BibleGetIO.getLocale(); String langsSupported; List<String> langsLocalized = new ArrayList<>(); String bbBooks; bibleGetDB = BibleGetDB.getInstance(); if (bibleGetDB != null) { //System.out.println("oh good, biblegetDB is not null!"); JsonReader jsonReader; langsSupported = bibleGetDB.getMetaData("LANGUAGES"); //System.out.println(langsSupported); jsonReader = Json.createReader(new StringReader(langsSupported)); bibleVersionsObj = jsonReader.readArray(); booksLangs = bibleVersionsObj.size(); for (JsonValue jsonValue : bibleVersionsObj) { //System.out.println(jsonValue.toString()); langsLocalized.add(BibleGetI18N.localizeLanguage(jsonValue.toString())); } booksStr = StringUtils.join(langsLocalized, ", "); List<JsonArray> bibleBooksTemp = new ArrayList<>(); for (int i = 0; i < 73; i++) { bbBooks = bibleGetDB.getMetaData("BIBLEBOOKS" + Integer.toString(i)); jsonReader = Json.createReader(new StringReader(bbBooks)); JsonArray bibleBooksObj = jsonReader.readArray(); bibleBooksTemp.add(bibleBooksObj); } String curLang; List<String[]> booksForCurLang; //bibleBooks = new HashMap<>(); booksAndAbbreviations = new HashMap<>(); String buildStr; for (int q = 0; q < bibleVersionsObj.size(); q++) { curLang = (bibleVersionsObj.getString(q) != null) ? BibleGetI18N.localizeLanguage(bibleVersionsObj.getString(q)).toUpperCase() : ""; buildStr = ""; for (int i = 0; i < 73; i++) { String styleStr = ""; if (bibleVersionsObj.getString(q).equals("TAMIL") || bibleVersionsObj.getString(q).equals("KOREAN")) { styleStr = " style=\"font-family:'Arial Unicode MS';\""; } JsonArray curBook = bibleBooksTemp.get(i); JsonArray curBookCurLang = curBook.getJsonArray(q); String str1 = (curBookCurLang.getString(0) != null) ? curBookCurLang.getString(0) : ""; String str2 = (curBookCurLang.getString(1) != null) ? curBookCurLang.getString(1) : ""; buildStr += "<tr><td" + styleStr + ">" + str1 + "</td><td" + styleStr + ">" + str2 + "</td></tr>"; //buildStr += "<tr><td style=\"font-family:'Arial Unicode MS';\">"+str1+"</td><td style=\"font-family:'Arial Unicode MS';\">"+str2+"</td></tr>"; } booksAndAbbreviations.put(curLang, buildStr); } } else { booksLangs = 0; booksStr = ""; } kit = new HTMLEditorKit(); doc = kit.createDefaultDocument(); styles = kit.getStyleSheet(); styles.addRule("body { background-color: #FFFFDD; border: 2px inset #CC9900; }"); styles.addRule("h1 { color: #0000AA; }"); styles.addRule("h2 { color: #0000AA; }"); styles.addRule("h3 { color: #0000AA; }"); styles.addRule("p { text-align: justify; }"); styles.addRule("table { border-collapse: collapse; width: 600px; margin-left: auto; }"); styles.addRule( "th { text-align: center; border: 4px ridge #DEB887; background-color: #F5F5DC; padding: 3px; }"); styles.addRule( "td { text-align: justify; border: 3px ridge #DEB887; background-color: #F5F5DC; padding: 3px; }"); //System.out.println("We have package path in BibleGetHelp! It is: "+packagePath); HTMLStr0 = "<html><head><meta charset=\"utf-8\"></head><body>" + "<h1>" + __("Help for BibleGet (Open Office Writer)") + "</h1>" + "<p>" + __("This Help dialog window introduces the user to the usage of the BibleGet I/O plugin for Open Office Writer.") + "</p>" + "<p>" + __("The Help is divided into three sections:") + "</p>" + "<ul>" + "<li>" + __("Usage of the Plugin") + "</li>" + "<li>" + __("Formulation of the Queries") + "</li>" + "<li>" + __("Biblical Books and Abbreviations") + "</li>" + "</ul>" + "<p><b>" + __("AUTHOR") + ":</b> " + __("John R. D'Orazio (chaplain at Roma Tre University)") + "</p>" + "<p><b>" + __("COLLABORATORS") + ":</b> " + __("Giovanni Gregori (computing) and Simone Urbinati (MUG Roma Tre)") + "</p>" + "<p><b>" + __("Version").toUpperCase() + ":</b> " + String.valueOf(BibleGetIO.VERSION) + "</p>" + "<p> <b>Copyright 2014 BibleGet I/O by John R. D'Orazio</b> <span style=\"color:blue;\">john.dorazio@cappellaniauniroma3.org</span></p>" + "<p><b>" + __("PROJECT WEBSITE") + ": </b><span style=\"color:blue;\">http://www.bibleget.io</span> | <b>" + __("EMAIL ADDRESS FOR INFORMATION OR FEEDBACK ON THE PROJECT") + ":</b> <span style=\"color:blue;\">bibleget.io@gmail.com</span></p>" + "<p>Cappellania Universit degli Studi Roma Tre - Piazzale San Paolo 1/d - 00120 Citt del Vaticano - +39 06.69.88.08.09 - <span style=\"color:blue;\">cappellania.uniroma3@gmail.com</span></p></body></html>"; String strfmt1 = __("Insert quote from input window"); String strfmt2 = __("About this plugin"); String strfmt3 = __("RENEW SERVER DATA"); String strfmt4 = strfmt1; String strfmt5 = __("Insert quote from text selection"); String strfmt6 = strfmt1; HTMLStr1 = "<html><head><meta charset=\"utf-8\"></head><body>" + "<h2>" + __("How to use the plugin") + "</h2>" + "<h3>" + __("Description of the menu icons and their functionality.") + "</h3>" + "<p>" + __("Once the extension is installed, a new menu 'BibleGet I/O' will appear on the menu bar. Also a new floating toolbar will appear. The buttons on the floating toolbar correspond to the menu items in the new menu, as can be seen in this image:") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot.jpg\" /><br /><br />" + "<p>" + __("The floating toolbar can be dragged and placed anywhere on the screen. It can also be docked to certain areas of the workspace, for example on the toolbar below the menu bar, like in this image:") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot2.jpg\" /><br /><br />" + "<p>" + __("There are two ways of inserting a bible quote into a document.") + " " + __("The first way is by using the input window.") + " " + MessageFormat.format(__( "If you click on the menu item ''{0}'', an input window will open where you can input your query and choose the version or versions you would like to take the quote from."), strfmt1) + " " + __("This list of versions is updated from the available versions on the BibleGet server, but since the information is stored locally it may be necessary to renew the server information when new versions are added to the BibleGet server database.") + " " + MessageFormat.format(__( "In order to renew the information from the BibleGet server, click on the ''{0}'' menu item, and then click on the button ''{1}''."), strfmt2, strfmt3) + " " + MessageFormat.format(__( "When you choose a version or multiple versions to quote from, this choice is automatically saved as a preference, and will be pre-selected the next time you open the ''{0}'' menu item."), strfmt4) + "<br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot4.jpg\" /><br /><br />" + MessageFormat.format(__( "The second way is by writing your desired quote directly in the document, and then selecting it and choosing the menu item ''{0}''. The selected text will be substituted by the Bible Quote retrieved from the BibleGet server."), strfmt5) + " " + MessageFormat.format(__( "The versions previously selected in the ''{0}'' window will be used, so you must have selected your preferred versions at least once from the ''{0}'' window."), strfmt6) + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot3.jpg\" /><br /><br />" + "<p>" + __("Formatting preferences can be set using the 'Preferences' window. You can choose the desired font for the Bible quotes as well as the desired line-spacing, and you can choose separate formatting (font size, font color, font style) for the book / chapter, for the verse numbers, and for the verse text. Preferences are saved automatically.") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot5.jpg\" /><br /><br />" + "<p>" + __("After the 'Help' menu item that opens up this same help window, the last three menu items are:") + "</p>" + "<ul>" + "<li><img src=\"" + packagePath + "/images/email.png\" />" + " '" + __("Send feedback") + "': <span>" + __("This will open up your system's default email application with the bibleget.io@gmail.com feedback address already filled in.") + "</span></li>" + "<li><img src=\"" + packagePath + "/images/paypal.png\" />" + " '" + __("Contribute") + "': <span>" + __("This will open a Paypal page in the system's default browser where you can make a donation to contribute to the project. Even just 1 can help to cover the expenses of this project. Just the server costs 120 a year.") + "</span></li>" + "<li><img src=\"" + packagePath + "/images/info.png\" />" + " '" + __("Information on the BibleGet I/O Project") + "': <span>" + __("This opens a dialog window with some information on the project and it's plugins, on the author and contributors, and on the current locally stored information about the versions and languages that the BibleGet server supports.") + "</span></li>" + "</ul>" + "</body></html>"; String strfmt7 = __("Biblical Books and Abbreviations"); HTMLStr2 = "<html>" + "<head><meta charset=\"utf-8\"></head>" + "<body>" + "<h2>" + __("How to formulate a bible query") + "</h2>" + "<p>" + __("The queries for bible quotes must be formulated using standard notation for bible citation.") + " " + __("This can be either the english notation (as explained here: https://en.wikipedia.org/wiki/Bible_citation), or the european notation as explained here below. ") + "</p>" + "<p>" + __("A basic query consists of at least two elements: the bible book and the chapter.") + " " + __("The bible book can be written out in full, or in an abbreviated form.") + " " + MessageFormat.format(__( "The BibleGet engine recognizes the names of the books of the bible in {0} different languages: {1}"), Integer.toString(booksLangs), booksStr) + " " + MessageFormat.format(__("See the list of valid books and abbreviations in the section {0}."), "<span class=\"internal-link\" id=\"to-bookabbrevs\">" + strfmt7 + "</span>") + " " + __("For example, the query \"Matthew 1\" means the book of Matthew (or better the gospel according to Matthew) at chapter 1.") + " " + __("This can also be written as \"Mt 1\".") + "</p>" + "<p>" + __("Different combinations of books, chapters, and verses can be formed using the comma delimiter and the dot delimiter (in european notation, in english notation instead a colon is used instead of a comma and a comma is used instead of a dot):") + "</p>" + "<ul>" + "<li>" + __("\",\": the comma is the chapter-verse delimiter. \"Matthew 1,5\" means the book (gospel) of Matthew, chapter 1, verse 5. (In English notation: \"Matthew 1:5\".)") + "</li>" + "<li>" + __("\".\": the dot is a delimiter between verses. \"Matthew 1,5.7\" means the book (gospel) of Matthew, chapter 1, verses 5 and 7. (In English notation: \"Matthew 1:5,7\".)") + "</li>" + "<li>" + __("\"-\": the dash is a range delimiter, which can be used in a variety of ways:") + "<ol>" + "<li>" + __("For a range of chapters: \"Matthew 1-2\" means the gospel according to Matthew, from chapter 1 to chapter 2.") + "</li>" + "<li>" + __("For a range of verses within the same chapter: \"Matthew 1,1-5\" means the gospel according to Matthew, chapter 1, from verse 1 to verse 5. (In English notation: \"Matthew 1:1-5\".)") + "</li>" + "<li>" + __("For a range of verses that span over different chapters: \"Matthew 1,5-2,13\" means the gospel according to Matthew, from chapter 1, verse 5 to chapter 2, verse 13. (In English notation: \"Matthew 1:5-2:13\".)") + "</li>" + "</ol>" + "</ul>" + "<p>" + __("Different combinations of these delimiters can form fairly complex queries, for example \"Mt1,1-3.5.7-9\" means the gospel according to Matthew, chapter 1, verses 1 to 3, verse 5, and verses 7 to 9. (In English notation: \"Mt1:1-3,5,7-9\".)") + "</p>" + "<p>" + __("Multiple queries can be combined together using a semi-colon \";\".") + " " + __("If the query following the semi-colon refers to the same book as the preceding query, it is not necessary to indicate the book a second time.") + " " + __("For example, \"Matthew 1,1;2,13\" means the gospel according to Matthew, chapter 1 verse 1 and chapter 2 verse 13. (In English notation: \"Matthew 1:1;2:13\".)") + " " + __("Here is an example of multiple complex queries combined into a single querystring: \"Genesis 1,3-5.7.9-11.13;2,4-9.11-13;Apocalypse 3,10.12-14\". (In English notation: \"Genesis 1:3-5,7,9-11,13;2:4-9,11-13;Apocalypse 3:10,12-14\").") + "</p>" + "<p>" + __("It doesn't matter whether or not you use a space between the book and the chapter, the querystring will be interpreted just the same.") + __("It is also indifferent whether you use uppercase or lowercase letters, the querystring will be interpreted just the same.") + "</p>" + "</body>" + "</html>"; HTMLStr3 = "<html>" + "<head><meta charset=\"utf-8\"></head>" + "<body>" + "<h2>" + __("Biblical Books and Abbreviations") + "</h2>" + "<p>" + __("Here is a list of valid books and their corresponding abbreviations, either of which can be used in the querystrings.") + " " + __("The abbreviations do not always correspond with those proposed by the various editions of the Bible, because they would conflict with those proposed by other editions.") + " " + __("For example some english editions propose \"Gn\" as an abbreviation for \"Genesis\", while some italian editions propose \"Gn\" as an abbreviation for \"Giona\" (= \"Jonah\").") + " " + __("Therefore you will not always be able to use the abbreviations proposed by any single edition of the Bible, you must use the abbreviations that are recognized by the BibleGet engine as listed in the following table:") + "</p><br /><br />" + "<table cellspacing='0'>" + "<caption>{1}</caption>" + "<tr><th style=\"width:70%;\">" + __("BOOK") + "</th><th style=\"width:30%;\">" + __("ABBREVIATION") + "</th></tr>" + "{0}" + "</table>" + "</body>" + "</html>"; Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); screenWidth = (int) screenSize.getWidth(); screenHeight = (int) screenSize.getHeight(); frameWidth = 1250; frameHeight = 700; frameLeft = (screenWidth / 2) - (frameWidth / 2); frameTop = (screenHeight / 2) - (frameHeight / 2); initComponents(); }
From source file:co.com.soinsoftware.hotelero.view.JFRoomService.java
public JFRoomService() { this.invoiceController = new InvoiceController(); this.serviceController = new ServiceController(); invoiceItemController = new InvoiceItemController(); serviceTypeController = new ServiceTypeController(); this.initComponents(); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((int) (screenSize.getWidth() / 2 - 350), (int) (screenSize.getHeight() / 2 - 350)); this.setModal(true); }
From source file:org.martus.client.swingui.PureFxMainWindow.java
@Override public void restoreWindowSizeAndState() { Dimension appDimension = getUiState().getCurrentAppDimension(); Point appPosition = getUiState().getCurrentAppPosition(); boolean showMaximized = getUiState().isCurrentAppMaximized(); if (appDimension.getHeight() == 0 || appDimension.getWidth() == 0) { showMaximized = true;//from w w w . j a v a 2 s. co m } else { realStage.setWidth(appDimension.getWidth()); realStage.setHeight(getNonFullScreenHeight(appDimension.getHeight())); } realStage.setX(appPosition.getX()); realStage.setY(appPosition.getY()); realStage.setMaximized(showMaximized); getUiState().setCurrentAppDimension(getMainWindowSize()); }
From source file:RasterTest.java
public void updateRenderRaster() { // takes the Depth Raster and updates the Render Raster // containing the image based on the depth values stored in // the Depth Raster. // create a temporary BufferedImage for the depth components BufferedImage tempBufferedImage = new BufferedImage(m_DepthRaster.getDepthComponent().getWidth(), m_DepthRaster.getDepthComponent().getHeight(), BufferedImage.TYPE_INT_RGB); // allocate an array of ints to store the depth components from the // Depth Raster if (m_DepthData == null) m_DepthData = new int[m_DepthRaster.getDepthComponent().getWidth() * m_DepthRaster.getDepthComponent().getHeight()]; // copy the depth values from the Raster into the int array ((DepthComponentInt) m_DepthRaster.getDepthComponent()).getDepthData(m_DepthData); // assign the depth values to the temporary image, the integer depths // will be//from w w w .j a v a2 s. c o m // interpreted as integer rgb values. tempBufferedImage.setRGB(0, 0, m_DepthRaster.getDepthComponent().getWidth(), m_DepthRaster.getDepthComponent().getHeight(), m_DepthData, 0, m_DepthRaster.getDepthComponent().getWidth()); // get a graphics device for the image Graphics g = tempBufferedImage.getGraphics(); Dimension size = new Dimension(); m_RenderRaster.getSize(size); // because the Depth Raster is a different size to the Render Raster, // i.e. the Depth Raster is canvas width by canvas height and the Render // Raster // is of aritrary size, we rescale the image here. g.drawImage(tempBufferedImage, 0, 0, (int) size.getWidth(), (int) size.getHeight(), null); // finally, assign the scaled image to the RenderRaster m_RenderRaster.setImage(new ImageComponent2D(BufferedImage.TYPE_INT_RGB, tempBufferedImage)); }
From source file:org.martus.client.swingui.PureFxMainWindow.java
@Override public void createAndShowModalDialog(FxShellController controller, Dimension preferedDimension, String titleTag) throws Exception { PureFxDialogStage dialogStage = new PureFxDialogStage(this, controller); if (preferedDimension != null) { dialogStage.getActualStage().setHeight(preferedDimension.getHeight()); dialogStage.getActualStage().setWidth(preferedDimension.getWidth()); }/*from ww w. j av a 2s . c om*/ dialogStage.showCurrentPage(); updateIcon(); dialogStage.showAndWait(); }