From: <cr...@us...> - 2009-03-26 13:04:13
|
Revision: 5157 http://jnode.svn.sourceforge.net/jnode/?rev=5157&view=rev Author: crawley Date: 2009-03-26 13:04:02 +0000 (Thu, 26 Mar 2009) Log Message: ----------- Javadoc fixes Modified Paths: -------------- trunk/gui/src/awt/org/jnode/awt/font/TextRenderer.java trunk/gui/src/awt/org/jnode/awt/font/renderer/GlyphRenderer.java trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderCache.java trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderContext.java trunk/gui/src/awt/org/jnode/awt/font/renderer/SummedAreaTable.java trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractFontProvider.java trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractTextRenderer.java trunk/gui/src/awt/org/jnode/awt/font/spi/Glyph.java trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontData.java trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFSimpleTextRenderer.java trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFTextRenderer.java trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFontProvider.java trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/OS2Table.java trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/TTFTable.java trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics.java trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics2D.java trunk/gui/src/driver/org/jnode/driver/video/FrameBufferAPI.java trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Configuration.java trunk/gui/src/driver/org/jnode/driver/video/util/Curves.java trunk/gui/src/driver/org/jnode/driver/video/util/VesaGTF.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java trunk/gui/src/driver/org/jnode/driver/video/vgahw/DisplayMode.java Modified: trunk/gui/src/awt/org/jnode/awt/font/TextRenderer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/TextRenderer.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/TextRenderer.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -33,11 +33,15 @@ /** * Render a given text to the given graphics at the given location. * - * @param g + * @param surface + * @param clip + * @param tx * @param text * @param x * @param y + * @param color */ - public void render(Surface g, Shape clip, AffineTransform tx, CharSequence text, int x, int y, Color color); + public void render(Surface surface, Shape clip, AffineTransform tx, CharSequence text, + int x, int y, Color color); } Modified: trunk/gui/src/awt/org/jnode/awt/font/renderer/GlyphRenderer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/renderer/GlyphRenderer.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/renderer/GlyphRenderer.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -62,11 +62,11 @@ } /** - * Create a raster that can be used in {@link #createGlyphRaster(double)}. + * Create a raster that can be used in {@link #createGlyphRaster(WritableRaster, double)}. * * @param width * @param height - * @return + * @return the raster */ public static final WritableRaster createRaster(int width, int height) { final ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY); @@ -113,7 +113,7 @@ * into the raster. * * @param fontSize - * @return + * @return the location as a Point2D */ public Point2D getMinLocation(double fontSize) { final double scale = MASTER_HEIGHT / fontSize; @@ -124,7 +124,7 @@ * Creates a master shape of the letter. * * @param shape - * @return + * @return the master shape */ private final Master createMaster(RenderContext ctx, Shape shape, double ascent) { Modified: trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderCache.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderCache.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderCache.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -61,7 +61,7 @@ /** * Gets the current rendering context. * - * @return + * @return the RenderContext */ public final RenderContext getContext() { return ctx; Modified: trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderContext.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderContext.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/renderer/RenderContext.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -36,8 +36,8 @@ /** * Gets an object out of this context with a given key. * - * @param key - * @return + * @param key the key + * @return the cached object or {code null} */ public Object getObject(Object key) { final WeakReference<?> ref = objects.get(key); @@ -49,10 +49,10 @@ } /** - * Gets an object out of this context with a given key. + * Stores an object in this context with a given key. * - * @param key - * @return + * @param key the key + * @param value the object */ public void setObject(Object key, Object value) { final WeakReference<?> ref = objects.get(key); Modified: trunk/gui/src/awt/org/jnode/awt/font/renderer/SummedAreaTable.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/renderer/SummedAreaTable.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/renderer/SummedAreaTable.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -36,7 +36,8 @@ /** * Initialize this instance from a given 1 banded raster. * - * @param src + * @param width + * @param height */ protected SummedAreaTable(int width, int height) { this.width = width; @@ -47,7 +48,9 @@ /** * Initialize this instance from a given 1 banded raster. * - * @param src + * @param master + * @param width + * @param height */ public static SummedAreaTable create(BitSet master, int width, int height) { final int size = width * height; @@ -79,7 +82,7 @@ * Gets a value out of the table at a given offset. * * @param offset - * @return + * @return the retrieved value */ protected abstract int get(int offset); @@ -95,7 +98,7 @@ * * @param x * @param y - * @return + * @return the sum */ @Inline public final int getSum(int x, int y) { @@ -117,7 +120,7 @@ * @param y * @param w * @param h - * @return + * @return the intensity */ public final float getIntensity(int x, int y, int w, int h) { if (x < 0) { Modified: trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractFontProvider.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractFontProvider.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractFontProvider.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -57,19 +57,24 @@ * Cache font renderers */ private final HashMap<Font, TextRenderer> renderers = new HashMap<Font, TextRenderer>(); + /** * Cache font metrics */ private final HashMap<Font, FontMetrics> metrics = new HashMap<Font, FontMetrics>(); + /** * All loaded fonts (name, Font) */ private final HashMap<String, F> fontsByName = new HashMap<String, F>(); + /** * Have the system fonts been loaded yet */ private boolean fontsLoaded = false; + private final RenderContext context = new RenderContext(); + /** * The render cache */ @@ -102,7 +107,7 @@ * Does this provides provide the given font? * * @param font - * @return True if this provider provides the given font, false otherwise + * @return {@code true} if this provider provides the given font, {@code false} otherwise */ public final boolean provides(Font font) { if (font == null) return false; // don't provide default (null) fonts @@ -112,14 +117,17 @@ } /** - * Returns a set containing a one-point size instance of all fonts available in this provider. - * Typical usage would be to allow a user to select a particular font. Then, the application can size - * the font and set various font attributes by calling the deriveFont method on the choosen instance. - * This method provides for the application the most precise control over which Font instance is - * used to render text. If a font in this provider has multiple programmable variations, only one instance of that - * Font is returned in the set, and other variations must be derived by the application. If a font in this provider - * has multiple programmable variations, such as Multiple-Master fonts, only one instance of that font is returned - * in the Font set. The other variations must be derived by the application. + * Returns a set containing a one-point size instance of all fonts available + * in this provider. Typical usage would be to allow a user to select a particular + * font. Then, the application can size the font and set various font attributes + * by calling the deriveFont method on the choosen instance. + * This method provides for the application the most precise control over which + * Font instance is used to render text. If a font in this provider has multiple + * programmable variations, only one instance of that Font is returned in the set, + * and other variations must be derived by the application. If a font in this provider + * has multiple programmable variations, such as Multiple-Master fonts, only + * one instance of that font is returned in the Font set. The other variations + * must be derived by the application. * * @return The set containing all fonts provides by this provider. */ @@ -188,7 +196,7 @@ * Translates the font into a font that is provided by this provider. * * @param font - * @return + * @return the compatible font */ @Override public final F getCompatibleFont(Font font) { Modified: trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractTextRenderer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractTextRenderer.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractTextRenderer.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -61,7 +61,8 @@ * Create a new instance * * @param fontData - * @param fontSize + * @param fontMetrics + * @param renderCache */ public AbstractTextRenderer(RenderCache renderCache, FontMetrics fontMetrics, FontData fontData) { @@ -73,7 +74,7 @@ /** * Create/get the alpha raster used for rendering. * - * @return + * @return the alpha raster */ protected final WritableRaster createAlphaRaster() { final RenderContext ctx = renderCache.getContext(); @@ -87,14 +88,6 @@ return r; } - /** - * Render a given text to the given graphics at the given location. - * - * @param g - * @param text - * @param x - * @param y - */ public void render(Surface surface, Shape clip, AffineTransform tx, CharSequence text, int x, int y, Color color) { try { Modified: trunk/gui/src/awt/org/jnode/awt/font/spi/Glyph.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/spi/Glyph.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/spi/Glyph.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -35,8 +35,10 @@ /** * Initialize this instance; * - * @param in - * @throws java.io.IOException + * @param xMin + * @param yMin + * @param xMax + * @param yMax */ protected Glyph(int xMin, int yMin, int xMax, int yMax) { this.xMin = xMin; Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontData.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontData.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontData.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -52,8 +52,6 @@ /** * Initialize this instance. - * - * @param input */ protected TTFFontData() { } @@ -79,7 +77,7 @@ /** * Gets the version of this font data. * - * @return + * @return the version number */ public abstract int getFontVersion(); @@ -87,7 +85,7 @@ /** * Create a new table with a given table. * - * @param tag + * @param tc * @param input * @throws IOException */ @@ -100,6 +98,7 @@ * Show the contents of this font data. */ public void show() { + // FIXME ... ick ... pass an OutputStream parameter or return a String System.out.println("Tables:"); for (Object v : tables.values()) { System.out.println(v); Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFSimpleTextRenderer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFSimpleTextRenderer.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFSimpleTextRenderer.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -60,15 +60,8 @@ this.fontSize = fontSize; } - /** - * Render a given text to the given graphics at the given location. - * - * @param g - * @param text - * @param x - * @param y - */ - public void render(Surface sf, Shape clip, AffineTransform tx2, CharSequence text, int x, int y, Color c) { + public void render(Surface surface, Shape clip, AffineTransform tx, CharSequence text, + int x, int y, Color c) { try { final GeneralPath gp = new GeneralPath(); gp.moveTo(x, y); @@ -90,12 +83,12 @@ } final double ascent = hheadTable.getAscent(); - final AffineTransform tx = new AffineTransform(); + final AffineTransform tx2 = new AffineTransform(); final double scale = fontSize / (-hheadTable.getDescent() + ascent); - tx.translate(x, y + fontSize); - tx.scale(scale, -scale); - tx.translate(0, ascent); + tx2.translate(x, y + fontSize); + tx2.scale(scale, -scale); + tx2.translate(0, ascent); for (int i = 0; i < text.length(); i++) { // get the index for the needed glyph @@ -103,11 +96,11 @@ final int index = encTable.getTableFormat().getGlyphIndex(character); if (character != ' ') { Shape shape = ((ShapedGlyph) glyphTable.getGlyph(index)).getShape(); - gp.append(shape.getPathIterator(tx), false); + gp.append(shape.getPathIterator(tx2), false); } - tx.translate(hmTable.getAdvanceWidth(index), 0); + tx2.translate(hmTable.getAdvanceWidth(index), 0); } - sf.draw(gp, clip, tx2, c, Surface.PAINT_MODE); + surface.draw(gp, clip, tx, c, Surface.PAINT_MODE); } catch (IOException ex) { log.error("Error drawing text", ex); } Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFTextRenderer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFTextRenderer.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFTextRenderer.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -42,6 +42,7 @@ * @author epr */ public class TTFTextRenderer extends AbstractTextRenderer { + /** * Create a new instance * @@ -54,14 +55,6 @@ super(renderCache, fontMetrics, fontData); } - /** - * Render a given text to the given graphics at the given location. - * - * @param g - * @param text - * @param x - * @param y - */ public void render(Surface surface, Shape clip, AffineTransform tx, CharSequence text, int x, int y, Color color) { try { Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFontProvider.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFontProvider.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFontProvider.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -78,7 +78,7 @@ * * @param name * @param attrs - * @return + * @return the font peer created */ @Override public TTFFontPeer createFontPeer(String name, Map attrs) { @@ -110,7 +110,7 @@ * Read an create a Font from the given InputStream * * @param stream - * @return + * @return the font created */ @Override public TTFFont createFont(InputStream stream) throws FontFormatException, IOException { Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/OS2Table.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/OS2Table.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/OS2Table.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -114,7 +114,7 @@ } /** - * @return + * @return the fsSelection */ public final int getFsSelection() { return this.fsSelection; Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/TTFTable.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/TTFTable.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/tables/TTFTable.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -68,7 +68,7 @@ /** * Gets the input handler for this table. * - * @return + * @return the TTF input handler */ protected final TTFInput getInput() { return input; @@ -84,7 +84,7 @@ /** * Gets the tag of this table. * - * @return + * @return the tag */ public abstract String getTag(); Modified: trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -20,6 +20,8 @@ package org.jnode.awt.image; +import gnu.java.awt.java2d.AbstractGraphics2D; + import java.awt.Graphics; import java.awt.GraphicsConfiguration; import java.awt.image.BufferedImage; @@ -81,7 +83,7 @@ * Returns a WritableRaster that is used by this class to perform the * rendering in. It is not necessary that the target surface immediately * reflects changes in the raster. Updates to the raster are notified via - * {@link #updateRaster}. + * {@link AbstractGraphics2D#updateRaster}. * * @return the destination raster */ Modified: trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics2D.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics2D.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/awt/org/jnode/awt/image/JNodeBufferedImageGraphics2D.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -20,6 +20,8 @@ package org.jnode.awt.image; +import gnu.java.awt.java2d.AbstractGraphics2D; + import java.awt.GraphicsConfiguration; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; @@ -94,7 +96,7 @@ * Returns a WritableRaster that is used by this class to perform the * rendering in. It is not necessary that the target surface immediately * reflects changes in the raster. Updates to the raster are notified via - * {@link #updateRaster}. + * {@link AbstractGraphics2D#updateRaster}. * * @return the destination raster */ Modified: trunk/gui/src/driver/org/jnode/driver/video/FrameBufferAPI.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/FrameBufferAPI.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/FrameBufferAPI.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -53,7 +53,7 @@ /** * Is there an open framebuffer configuration. * - * @return + * @return {@code true} if there is, otherwise {@code false} */ public boolean isOpen(); @@ -62,7 +62,7 @@ * The old owner (if any) will receive a request to stop using the underlying FrameBuffer device. * * @param owner - * @return true if owner can now start using exclusively the underlying FrameBuffer device. + * @return {@code true} if owner can now start using exclusively the underlying FrameBuffer device. */ public void requestOwnership(FrameBufferAPIOwner owner); @@ -70,14 +70,15 @@ * Request the ownership on the underlying FrameBuffer device. * * @param owner - * @return true if owner can now start using exclusively the underlying FrameBuffer device. + * @return {@code true} if owner can now start using exclusively the underlying FrameBuffer device. */ public void releaseOwnership(FrameBufferAPIOwner owner); /** * Gets the currently opened framebuffer configuration. * - * @return + * @return the configuration */ public Surface getCurrentSurface() throws NotOpenException; + // FIXME ... we do we refer to the Surface as a 'configuration'??? } Modified: trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Configuration.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Configuration.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Configuration.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -67,7 +67,7 @@ * Create a color model for a given bits per pixel. * * @param bpp - * @return + * @return the color model */ private static ColorModel createColorModel(int bpp) { return new DirectColorModel(bpp, 0xff0000, 0x00ff00, 0x0000ff); @@ -83,7 +83,7 @@ /** * Gets the number of bytes per line * - * @return + * @return the number of bytes per line */ public final int getBytesPerLine() { return (displayMode.getWidth() * bitsPerPixel) >> 3; Modified: trunk/gui/src/driver/org/jnode/driver/video/util/Curves.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/util/Curves.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/util/Curves.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -57,6 +57,7 @@ * @param x3 * @param y3 * @param points The resulting points + * @return the number of points updated in points array */ public static int calculateCubicCurve(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double points[]) { @@ -96,7 +97,7 @@ * @param x3 * @param y3 * @param points The resulting points - * @return int number of points in points array + * @return the number of points updated in points array */ public static int calculateCubicCurveOpt2(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double[] points) { @@ -163,6 +164,7 @@ * @param x2 * @param y2 * @param points The resulting points + * @return the number of points updated in points array */ public static int calculateQuadCurve(double x0, double y0, double x1, double y1, double x2, double y2, double points[]) { @@ -198,9 +200,8 @@ * @param y1 * @param x2 * @param y2 - * @param points * @param points The resulting points - * @return int number of points in points array + * @return the number of points updated in points array */ public static int calculateQuadCurveOpt2(double x0, double y0, double x1, double y1, double x2, double y2, double points[]) { Modified: trunk/gui/src/driver/org/jnode/driver/video/util/VesaGTF.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/util/VesaGTF.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/util/VesaGTF.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -1,25 +1,23 @@ package org.jnode.driver.video.util; /** - * This is a implementation of Vesa's General Timing Formular base on the code + * This is a implementation of Vesa's General Timing Formula base on the code * of the Linux gtf tool - * + * <p> * Timing description I'm accustomed to: - * - * - * + * <pre> * <--------1--------> <--2--> <--3--> <--4--> _________ * |-------------------|_______| |_______ * * R SS SE FL - * + * </pre> * 1: visible image 2: blank before sync (aka front porch) 3: sync pulse 4: * blank after sync (aka back porch) R: Resolution SS: Sync Start SE: Sync End * FL: Frame Length */ public class VesaGTF { - /* asumed character width in pixels */ + /* assumed character width in pixels */ private static final double CELL_GRAN = 8.0; /* minimum front porch */ @@ -82,27 +80,27 @@ /** * calculate the modelines for the given screen resolution and refresh rate. * - * @param width - * @param height + * @param hPixels + * @param vLines * @param frequency - * @return + * @return the modelines */ - public static VesaGTF calculate(int h_pixels, int v_lines, double freq) { + public static VesaGTF calculate(int hPixels, int vLines, double frequency) { - double total_active_pixels = Math.round(h_pixels / CELL_GRAN) + double total_active_pixels = Math.round(hPixels / CELL_GRAN) * CELL_GRAN; - double h_period_est = ((1.0 / freq) - (MIN_VSYNC_PLUS_BP / 1000000.0)) - / (v_lines + MIN_PORCH) * 1000000.0; + double h_period_est = ((1.0 / frequency) - (MIN_VSYNC_PLUS_BP / 1000000.0)) + / (vLines + MIN_PORCH) * 1000000.0; double vsync_plus_bp = Math.round(MIN_VSYNC_PLUS_BP / h_period_est); - double total_v_lines = v_lines + vsync_plus_bp + MIN_PORCH; + double total_v_lines = vLines + vsync_plus_bp + MIN_PORCH; double v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0; - double h_period = h_period_est / (freq / v_field_rate_est); + double h_period = h_period_est / (frequency / v_field_rate_est); double ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0); @@ -125,9 +123,9 @@ return new VesaGTF((int) total_active_pixels, (int) (total_active_pixels + h_front_porch), (int) (total_active_pixels + h_front_porch + h_sync), - (int) total_pixels, v_lines, (int) (v_lines + MIN_PORCH), - (int) (v_lines + MIN_PORCH + V_SYNC_RQD), (int) total_v_lines, - pixel_freq, h_freq, freq); + (int) total_pixels, vLines, (int) (vLines + MIN_PORCH), + (int) (vLines + MIN_PORCH + V_SYNC_RQD), (int) total_v_lines, + pixel_freq, h_freq, frequency); } public int getHFrameLength() { Modified: trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -54,18 +54,10 @@ } } - /** - * @see org.jnode.awt.util.BitmapGraphics#doCopyArea(int, int, int, int, - * int, int) - */ protected void doCopyArea(int x, int y, int width, int height, int dx, int dy) { // TODO Implement me } - /** - * @see org.jnode.awt.util.BitmapGraphics#doDrawImage(java.awt.image.Raster, - * int, int, int, int, int, int) - */ protected void doDrawImage(Raster src, int srcX, int srcY, int dstX, int dstY, int width, int height) { vgaIO.setGRAF(1, 0); @@ -127,19 +119,11 @@ vgaIO.setGRAF(1, 0x0F); } - /** - * @see org.jnode.awt.util.BitmapGraphics#doDrawImage(java.awt.image.Raster, - * int, int, int, int, int, int, int) - */ protected void doDrawImage(Raster src, int srcX, int srcY, int dstX, int dstY, int width, int height, int bgColor) { doDrawImage(src, srcX, srcY, dstX, dstY, width, height); } - /** - * @see org.jnode.awt.util.BitmapGraphics#doDrawLine(int, int, int, int, - * int) - */ protected void doDrawLine(int x, int y, int lineWidth, int color, int mode) { final int ofsY = y * 80; lineWidth = Math.min(this.width - x, lineWidth); @@ -163,10 +147,6 @@ } } - /** - * @see org.jnode.awt.util.BitmapGraphics#doDrawPixels(int, int, int, int, - * int) - */ protected void doDrawPixels(int x, int y, int count, int color, int mode) { for (int i = 0; i < count; i++) { final int bit = 0x80 >> (x & 7); @@ -177,10 +157,6 @@ } } - /** - * @see org.jnode.awt.util.BitmapGraphics#doDrawAlphaRaster(java.awt.image.Raster, - * int, int, int, int, int, int, int) - */ protected void doDrawAlphaRaster(Raster raster, int srcX, int srcY, int dstX, int dstY, int width, int height, int color) { // TODO Implement me Modified: trunk/gui/src/driver/org/jnode/driver/video/vgahw/DisplayMode.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/vgahw/DisplayMode.java 2009-03-26 11:50:49 UTC (rev 5156) +++ trunk/gui/src/driver/org/jnode/driver/video/vgahw/DisplayMode.java 2009-03-26 13:04:02 UTC (rev 5157) @@ -32,19 +32,25 @@ /** Visible display width in pixels */ private final int width; + /** h-sync pulse start */ private final int hsyncStart; + /** h-sync pulse end */ private final int hsyncEnd; + /** Total pixels per line */ private final int hTotal; /** Visible display height in lines */ private final int height; + /** v-sync pulse start */ private final int vsyncStart; + /** v-sync pulse end */ private final int vsyncEnd; + /** Total lines per frame */ private final int vTotal; @@ -72,11 +78,11 @@ * @param width * @param hsyncStart * @param hsyncEnd - * @param total + * @param hTotal * @param height * @param vsyncStart * @param vsyncEnd - * @param total2 + * @param vTotal */ public DisplayMode(int freq, int width, int hsyncStart, int hsyncEnd, int hTotal, int height, int vsyncStart, int vsyncEnd, int vTotal) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |