/* * [Connectors.java] * * Summary: Draws various connector pinouts teach the use of JPanel. * * Copyright: (c) 2011-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2011-01-09 initial version * 1.1 2011-01-10 improve artifacts using setOpaque, super.paintComponent and Graphics.create * 1.2 2011-01-19 drawRoundedPolygon fillRoundedPolygon * 1.3 2011-01-26 add R232C 25-pin and 9-pin connectors, male and female. More mathematical treatment of pins. */ package com.mindprod.connectors; import java.awt.Color; /** * Draws various connector pinouts teach the use of JPanel. *

* A teaching example for how to use Java JPanel, * fillRect, fillOval, fillPoly and AffineTransform to draw. * * @author Roedy Green, Canadian Mind Products * @version 1.3 2011-01-26 add R232C 25-pin and 9-pin connectors, male and female. More mathematical treatment of pins. * @since 2011-01-09 */ public class Connectors { private static final int FIRST_COPYRIGHT_YEAR = 2011; /** * undisplayed copyright notice * * @noinspection UnusedDeclaration */ private static final String EMBEDDED_COPYRIGHT = "Copyright: (c) 2011-2017 Roedy Green, Canadian Mind Products, http://mindprod.com"; /** * date this version released. * * @noinspection UnusedDeclaration */ private static final String RELEASE_DATE = "2011-01-26"; /** * embedded version string. * * @noinspection UnusedDeclaration */ private static final String VERSION_STRING = "1.3"; /** * Prepares a set of png files for various connectors. * * @param args not used */ public static void main( String[] args ) { new ChaosIcon( 256, 2 ).save( 256, "E:/mindprod/image/icon256/chaos.png" ); new ChaosIcon( 128, 2 ).save( 128, "E:/mindprod/image/icon128/chaos.png" ); new ChaosIcon( 64, 2 ).save( 64, "E:/mindprod/image/icon64/chaos.png" ); new ChaosIcon( 48, 2 ).save( 48, "E:/mindprod/image/icon48/chaos.png" ); new ChaosIcon( 32, 1 ).save( 32, "E:/mindprod/image/icon32/chaos.png" ); new ChaosIcon( 16, 1 ).save( 16, "E:/mindprod/image/icon16/chaos.png" ); if ( false ) { new USB2Header().save( 320, "E:/mindprod/image/electronic/usb2header.png" ); new Aerial().save( 1024, "E:/mindprod/dropoff/antenna.png" ); new RoundCornerMath().display(); new CrazyQuilt( 256, 20, 4 ).save( 256, "E:/mindprod/image/icon256/makekey.png" ); new CrazyQuilt( 128, 10, 2 ).save( 128, "E:/mindprod/image/icon128/makekey.png" ); new CrazyQuilt( 64, 8, 2 ).save( 64, "E:/mindprod/image/icon64/makekey.png" ); new CrazyQuilt( 48, 7, 1 ).save( 48, "E:/mindprod/image/icon48/makekey.png" ); new CrazyQuilt( 32, 6, 1 ).save( 32, "E:/mindprod/image/icon32/makekey.png" ); new CrazyQuilt( 16, 5, 1 ).save( 16, "E:/mindprod/image/icon16/makekey.png" ); new Octagon( Color.RED ).save( 20, "excludedir.png" ); // display on screen // new Pentagon( Color.YELLOW ).display(); // create PNG files new ACOutlet().save( 256 ); new MidiDinMale().save( 256 ); new Octagon( Color.RED ).save( 16, "excludefile.png" ); new Octagon( Color.RED ).save( 20, "excludedir.png" ); new Octagon( new Color( 0xffc8c8 ) ).save( 16, "inheritexcludefile.png" ); new Octagon( new Color( 0xffc8c8 ) ).save( 20, "inheritexcludedir.png" ); new Pentagon( Color.YELLOW ).save( 16, "inheritfile.png" ); new Pentagon( Color.YELLOW ).save( 20, "inheritdir.png" ); new Pentagon( Color.YELLOW ).save( 256, "pentagon.png" ); new RJ11Female().save( 256 ); new RJ45Female().save( 256 ); new RoundCornerMath().save( 512 ); new RS232C25Female().save( 256 ); new RS232C25Male().save( 256 ); new RS232C9Female().save( 256 ); new RS232C9Male().save( 256 ); new Triangle( Color.GREEN ).save( 16, "includefile.png" ); new Triangle( Color.GREEN ).save( 20, "includedir.png" ); new Triangle( new Color( 0xc8ffc8 ) ).save( 16, "inheritincludefile.png" ); new Triangle( new Color( 0xc8ffc8 ) ).save( 20, "inheritincludedir.png" ); new USB2aFemaleHorizontal().save( 50 ); new USB2aFemaleVertical().save( 30 ); new USB3aFemaleHorizontal().save( 50 ); new USB3aFemaleVertical().save( 30 ); new VGAMale().save( 256 ); } } }