Translucent border on a canvas?

I have a canvas with a thick border. I'd like to make it less
obvious, but there is no borderAlpha property. Can anyone suggest a
work-around?

I thought the alpha of a canvas affected the stroke and
backgroundAlpha affected the canvas inner frame. Not working as you
expect? If not, maybe you could share some code.

Similar Messages

  • Stacked canvas

    Hi
    I have a screen where part of the block is in a 'fixed' content canvas and part is in a stacked canvas which is scrollable. Initially, both canvases are displayed and I can scroll backwards and forwards in the stacked canvas. However, when I select one of the fields that is outside the stacked canvas the stacked canvas disappears. Is there anyway of pinning the stacked canvas so that it is visible all the time.
    Thanks

    Hi
    What i understand when your naviagation is on contact canvas item then stack canvas disappear.
    it is so simple just click on the border of stack canvas and drag the stack canvas away from the items of contant canvas. it may possible your stack canvas is over the any item of contant canvas
    Regards

  • Dashed border around any component

    Sorry if this a stupid question since I am very new to Flex.
    But, I cannot set the dashed or dotted border around mx:Canvas (or
    any other component for that matter). borderStyle allows only four
    settings: solid, inset, outset and none.
    Is there any easy way to achieve this?
    Thank you

    Here is an app using this class I posted to my web site,
    ChikaraDev.com. You can right
    click and select View Source.
    DashBorderExample

  • I can't move a layer in photoshop CS6 Beta for Mac. I just get a red border

    I can't move a layer in photoshop CS6 Beta for Mac. I just get a red border around the canvas. Any Ideas?

    You might want to try posting in the CS6 forum.
    http://forums.adobe.com/community/labs/photoshopcs6?view=discussions

  • Creating a border around a image

    I am trying to creat a bborder around our company logo so it can be put on a transparent sticker. I currently have the logo on a white background

    OK.. so this is going to be a bit tricky.
    Here is what I did to add a border to your logo:
    First, I added the half inch border to your canvas like I did in my past post...
    Then, select the white color, like my first post, and delete it.
    Then, go back to select color range, and sample all of the colors in the logo to select the whole logo.
    Then, expand the selection by however many pixel you'd like:
    Then, fill the selection with white, or whatever color you want the border to be:
    Hope this helps,
    Julia

  • How to make a mask border

    I just started using flash again for the first time in years and it has changed a lot. I was not very good at it when I was using it back when but I just made a little animation and I need to make a mask border around the canvas. I have multiple layers and folders and I want it all masked so that you can not see anything outside the canvas. Can anyone help me with this. And Please talk like you are talking to a retard cause I am not to far off right now.

    if you're doing this in the authoring environment (as opposed to using actionscript), create a rectangular fill with width x height = stage width x stage height in a new layer above all other layers.  right click that layer and click mask.
    now, with every layer in your project that's not indented below the mask layer, left click on the layer and slowly drag upwards a few pixels until you see a hatched line segment between the layer you're dragging and the layer above.  then release the layer and it should be indented indicating it will be masked.

  • Help Creating a Graph (of sorts) for Professional Driver Daily Logs

    Hey All!
    I'm working on a project for myself, that could go commercial if it gets as good as I'm hoping it will. This application (which I'm calling Truck Manager) will manage income and expenses, help plan trips, track trip/load information and do the US-MCSA/DOT regulated Driver's Daily Log. This log is a line graph that runs from midnight to midnight and has four lines: (1) Off Duty; (2) Sleeper Berth; (3) On Duty, Driving; and (4) On Duty, Not Driving. If anyone needs to see a paper form of this log book, just ask and I'll scan in one of my copies and post.
    Anyway, I'm using J2D to handle the log book "pages" and have already gotten the grid laid out just fine...it runs from midnight to midnight and is broken into 15-minute increments, with the four required lines described above. Now that I have that done, I've hit a logic block that is keeping me from figuring out the best and/or simplest way to log the status changes and time lines. For example, let's say that I work the following day:
    Midnight until 06:00 == off duty
    06:00 until 06:15 == on duty, not driving: performing pre-trip inspection
    06:15 until 08:00 == on duty, driving to customer to be loaded
    08:00 until 08:15 == on duty, not driving: being loaded (only required to log 15 minutes for this)
    08:15 until 09:00 == off duty (still being loaded)
    09:00 until 12:00 == on duty, driving (heading toward delivery)
    12:00 until 12:45 == off duty (lunch)
    12:45 until 15:00 == on duty, driving (heading toward delivery)
    15:00 until 15:15 == on duty, not driving (being unloaded)
    15:15 until 16:00 == off duty, (still being unloaded)
    16:00 until 20:00 == on duty, driving (heading home)
    20:00 until midnight == sleeper (ran out of hours)
    This graph would look like the following (provided each dash represents one 15-minute block:
    <pre>
    1. -----------------------| |---| |---| |---|
    2. | | | | | | | |----------------
    3. | -------| | |------------| |---------| | |----------------|
    4. |-| |-| |-|
    </pre>
    Though the above graph is crappy, it should give the idea of what needs to be done. At each change of status (i.e., from off duty to on duty, not driving) there must be a vertical line between the statuses, not going above and below like in the example above. Then, once the status changes again, the horizontal line needs to be drawn from the vertical line of the last status change to the time of the new status change and then the vertical line to the new status.
    The way the driver's daily log works is like this...When I come on duty, I am required to do a pre-trip inspection of my truck/trailer, which requires 15 minutes on duty, not driving, so I log that all at once, including the vertical line up to the 3rd line of the graph, which is on duty, driving. Then, in this example, I drive for 1.75 hours, until I arrive at my pick-up. Once I get there, I draw the horizontal line on line 3 of the graph, the vertical line down to line 4 (on duty, not driving), the 15-minute horizontal line and the vertical line up to line 1 (off duty). When I get ready to leave the pick-up after I am loaded, I draw the horizontal line across line 1, the vertical line down to line 3 and then drive until I stop.
    Other things that are desired for this graph logic is to take into account the US-MCSA/DOT regulations for drivers that state the following:
    a. A driver may not be on duty for more than 14 hours, without a 10-hour break
    - Nothing stops this "14-hour clock" except a 10-hour break, so if a driver comes on duty at 06:00 and spends 15 minutes doing the pre-trip inspection and then goes off duty for the next 8 hours, the 14-hour clock is still running and the driver will only have 5 hours and 45 minutes to work (roughly).
    b. A driver may not drive for more than 11 hours, without a 10-hour break, provided the 14-hour rule is obeyed.
    - In other words, even if a driver only drives for a total of 7 hours, but the 14-hour clock expires, the driver may not complete his/her 11 hours of driving allowed.
    c. A driver must take a break of 10 consecutive hours in each 24-hour period.
    *** This is confusing because the 10-hour break can span midnight and still be considered consecutive, even though part of the break is on one graph and the other part is on another graph.
    In taking these rules into account, I would like the graphing part of the program's logic to change the horizontal line color from blue (the regular line color) to red if the driver is in violation of the rules above. Where this gets really complicated is where the same status crosses midnight from day-to-day.
    As I said, I have successfully gotten the grid painted using java.awt.Graphics2D methods, but am having trouble coming up with the logic for drawing the driver status throughout the day. All data will be stored in a MySQL database table and can be pulled at any time that it is needed. The user will be entering the current status change time, as well as location (city and state) and a comment (which is not required, except for when doing a pre-trip inspection, fueling, loading or unloading), then clicking a button labeled "Update Log".
    Any help with the logic for this part of the application is greatly appreciated. If you can provide sample code to help demonstrate the logic you are describing, I will be grateful.
    Thank you all for your assistance. If you would like a better idea of what the daily log graph looks like, you can run the class below.
    Cheers,
    Sean
    <pre>
    * DriverLog.java: Driver's Daily Log entry screen. By completing the small form at the bottom of
    * dialog, the system will automatically update your log.
    * Created on Sep 30, 2010, 2:03:18 PM
    package net.pekinsoft.trkmgr.gui;
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Toolkit;
    * @author Sean Carrick
    public class DriverLog extends javax.swing.JFrame {
    // Private class-level variables.
    * @code{java.awt.Graphics2D} object that we will use for drawing on our
    * view port, which is a @code{javax.swing.JPanel} on our form. This view
    * port will hold our driver's log graph that shows the driver's status at
    * different times of the day based upon the data the driver provides.
    private Graphics2D canvas;
    * @code{java.awt.geom.Point} object to hold the starting x, y coordinates
    * for the driver's daily log off duty line.
    private Point offDutyStartPoint;
    * @code{java.awt.geom.Point} object to hold the ending x, y coordinates
    * for the driver's daily log off duty line.
    private Point offDutyEndingPoint;
    * @code{java.awt.geom.Point} object to hold the starting x, y coordinates
    * for the driver's daily log sleeper berth line.
    private Point sleeperStartPoint;
    * @code{java.awt.geom.Point} object to hold the ending x, y coordinates
    * for the driver's daily log sleeper berth line.
    private Point sleeperEndingPoint;
    * @code{java.awt.geom.Point} object to hold the starting x, y coordinates
    * for the driver's daily log driving line.
    private Point drivingStartPoint;
    * @code{java.awt.geom.Point} object to hold the ending x, y coordinates
    * for the driver's daily log driving line.
    private Point drivingEndingPoint;
    * @code{java.awt.geom.Point} object to hold the start x, y coordinates
    * for the driver's daily log not driving line.
    private Point notDrivingStartPoint;
    * @code{java.awt.geom.Point} object to hold the ending x, y coordinates
    * for the driver's daily log not driving line.
    private Point notDrivingEndingPoint;
    * @code{int} that holds the number of 15-minute blocks in a 24-hour period.
    private static final int qtrHourBlocks = (24 * 60) / 15;
    /** Creates new form DriverLog */
    public DriverLog() {
    // Initialize the window's components. {handled by NetBeans}
    initComponents();
    // Center the window on the screen.
    Toolkit tk = Toolkit.getDefaultToolkit();
    int winX = (tk.getScreenSize().width - getWidth()) / 2;
    int winY = (tk.getScreenSize().height - getHeight()) / 2;
    setLocation(winX, winY);
    // Initialize our drawing canvas.
    canvas = (Graphics2D) viewPort.getGraphics();
    // Next, we need to initialize our line starting and ending point objects.
    int qtr = (viewPort.getHeight() / 8);
    int y = qtr + 20;
    int startX = 20;
    int endX = viewPort.getWidth() - 20;
    offDutyStartPoint = new Point(startX, y);
    offDutyEndingPoint = new Point(endX, y);
    y = (qtr * 2) + 20; // Double the value of y
    sleeperStartPoint = new Point(startX, y);
    sleeperEndingPoint = new Point(endX, y);
    y = (qtr * 3) + 20; // Triple the value of y.
    drivingStartPoint = new Point(startX, y);
    drivingEndingPoint = new Point(endX, y);
    y = (qtr * 4) + 20; // Quadruple the value of y.
    notDrivingStartPoint = new Point(startX, y);
    notDrivingEndingPoint = new Point(endX, y);
    // Now that our objects have been initialized, we need to draw our grid.
    paint();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    bgrpStatus = new javax.swing.ButtonGroup();
    viewPort = new javax.swing.JPanel();
    lblStatusChange = new javax.swing.JLabel();
    txtStatusChange = new javax.swing.JFormattedTextField();
    rbtnOffDuty = new javax.swing.JRadioButton();
    rbtnSleeper = new javax.swing.JRadioButton();
    rbtnDriving = new javax.swing.JRadioButton();
    rbtnNotDriving = new javax.swing.JRadioButton();
    btnUpdate = new javax.swing.JButton();
    lblComment = new javax.swing.JLabel();
    txtComment = new javax.swing.JTextField();
    lblLocation = new javax.swing.JLabel();
    txtLocation = new javax.swing.JTextField();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Driver's Daily Log");
    setAlwaysOnTop(true);
    setResizable(false);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(java.awt.event.WindowEvent evt) {
    formWindowOpened(evt);
    addWindowStateListener(new java.awt.event.WindowStateListener() {
    public void windowStateChanged(java.awt.event.WindowEvent evt) {
    formWindowStateChanged(evt);
    javax.swing.GroupLayout viewPortLayout = new javax.swing.GroupLayout(viewPort);
    viewPort.setLayout(viewPortLayout);
    viewPortLayout.setHorizontalGroup(
    viewPortLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 674, Short.MAX_VALUE)
    viewPortLayout.setVerticalGroup(
    viewPortLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 351, Short.MAX_VALUE)
    lblStatusChange.setText("Status Change Time:");
    txtStatusChange.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
    new javax.swing.text.DateFormatter(new java.text.SimpleDateFormat("HH:mm"))));
    bgrpStatus.add(rbtnOffDuty);
    rbtnOffDuty.setSelected(true);
    rbtnOffDuty.setText("Off Duty");
    bgrpStatus.add(rbtnSleeper);
    rbtnSleeper.setText("Sleeper");
    bgrpStatus.add(rbtnDriving);
    rbtnDriving.setText("Driving");
    bgrpStatus.add(rbtnNotDriving);
    rbtnNotDriving.setText("On Duty; Not Driving");
    btnUpdate.setMnemonic('U');
    btnUpdate.setText("Update Driver Log");
    btnUpdate.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    btnUpdateActionPerformed(evt);
    lblComment.setText("Reason/Comment:");
    lblLocation.setText("Location: City, ST:");
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(viewPort, javax.swing.GroupLayout.DEFAULT_SIZE,
    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(lblLocation)
    .addComponent(lblStatusChange))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addGroup(layout.createSequentialGroup()
    .addComponent(txtStatusChange, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
    javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(18, 18, 18)
    .addComponent(rbtnOffDuty)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    .addComponent(rbtnSleeper)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    .addComponent(rbtnDriving)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    .addComponent(rbtnNotDriving)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
    65, Short.MAX_VALUE)
    .addComponent(btnUpdate))
    .addGroup(layout.createSequentialGroup()
    .addComponent(txtLocation, javax.swing.GroupLayout.DEFAULT_SIZE,
    232, Short.MAX_VALUE)
    .addGap(18, 18, 18)
    .addComponent(lblComment)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(txtComment, javax.swing.GroupLayout.PREFERRED_SIZE,
    227, javax.swing.GroupLayout.PREFERRED_SIZE)))))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(viewPort, javax.swing.GroupLayout.DEFAULT_SIZE,
    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGap(18, 18, 18)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(lblStatusChange)
    .addComponent(txtStatusChange, javax.swing.GroupLayout.PREFERRED_SIZE,
    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(rbtnOffDuty)
    .addComponent(rbtnSleeper)
    .addComponent(rbtnDriving)
    .addComponent(rbtnNotDriving)
    .addComponent(btnUpdate))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(txtComment, javax.swing.GroupLayout.PREFERRED_SIZE,
    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(lblComment)
    .addComponent(lblLocation)
    .addComponent(txtLocation, javax.swing.GroupLayout.PREFERRED_SIZE,
    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addContainerGap())
    pack();
    }// </editor-fold>
    private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {                                         
    // KEEP AS LAST LINE IN THIS FUNCTION!!! //
    paint();
    private void formWindowStateChanged(java.awt.event.WindowEvent evt) {                                       
    // Draw the driver's daily log grid.
    paint();
    private void formWindowOpened(java.awt.event.WindowEvent evt) {                                 
    // Draw the driver's daily log grid.
    paint();
    private void paint() {
    drawOutline();
    * @code{net.pekinsoft.gui.DriverLog.drawOutline()} function handles the
    * rendering of the driver's daily log grid outline only.
    private void drawOutline() {
    // Set up the starting point for our log grid's upper-left corner.
    int x = 0; // 20 points down from the top.
    int y = 0; // 20 points in from the left.
    int offset = 28;
    // Get the height and width of our log grid from the panel.
    int h = 112;
    int w = 671;
    // Set the color of our border to Red.
    canvas.setStroke(new BasicStroke(1));
    canvas.setPaint(Color.BLACK);
    // Draw our log graph outline.
    canvas.drawRect(x, y, w, h);
    // Draw our log's horizontal lines.
    for ( int i = 1; i < 5; i++ ) {
    canvas.drawLine(x, y + (i * offset), w + offset, y + (i * offset));
    // Draw our log's hour lines.
    for ( int i = 1; i < 24; i++ ) {
    canvas.drawLine(x + (i * offset), 0, x + (i * offset), 112);
    // Draw our log's 30-minute ticks.
    for ( int i = 1; i < 48; i++ ) {
    for ( int j = 0; j < 5; j++ ) {
    canvas.drawLine(x + (i * (offset / 2)), y + (j * offset),
    x + (i * (offset / 2)), (y + (j * offset) + 10));
    // Draw our log's 15-minute ticks.
    for ( int i = 1; i < 96; i++ ) {
    for ( int j = 0; j < 5; j++ ) {
    canvas.drawLine(x + (i * (offset / 4)), y + (j * offset),
    x + (i * (offset / 4)), (y + (j * offset) + 5));
    canvas.drawLine(0, 112, 0, 122);
    canvas.drawLine(w, 112, w, 122);
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new DriverLog().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.ButtonGroup bgrpStatus;
    private javax.swing.JButton btnUpdate;
    private javax.swing.JLabel lblComment;
    private javax.swing.JLabel lblLocation;
    private javax.swing.JLabel lblStatusChange;
    private javax.swing.JRadioButton rbtnDriving;
    private javax.swing.JRadioButton rbtnNotDriving;
    private javax.swing.JRadioButton rbtnOffDuty;
    private javax.swing.JRadioButton rbtnSleeper;
    private javax.swing.JTextField txtComment;
    private javax.swing.JTextField txtLocation;
    private javax.swing.JFormattedTextField txtStatusChange;
    private javax.swing.JPanel viewPort;
    // End of variables declaration
    </pre>
    Edited by: 799477 on Oct 1, 2010 2:42 PM

    <blockquote>Sean, I checked your code and seen that package net.pekinsoft..., is this an Illinois Company by any chance?</blockquote>
    Yes, this is a company that I have tried (unsuccessfully) to start in central Illinois...I'm guessing that the "Pekin" part gave it away.
    <blockquote>Thanks for posting the DB TABLE -- we'll need that later, plus I wanted to see if you would respond.</blockquote>
    Not a problem on the DB table. Why wouldn't I respond...I want and NEED help here... ;-)
    <blockquote>I have a few questions but don't want to complicate your line of thinking, so I'll just describe generally how I have approached a big project like this. </blockquote>
    I will answer them the best that I can.
    <blockquote>For one thing, I do not start with a GUI or even consider what I want it to look like... I start with the data, and how that data is broken down into different classes, and then how those classes come together to form an Object Hierarchy. I have and do maintain a large MySQL database myself with 18 TABLES. Some of the TABLES hold very little information which I use as static final information. As a matter of fact, one of those TABLES is called status and contains 5 fields. This status TABLE is storing 7 rows of information because I have 7 different levels. The fields in my status TABLE are status_id, status_type, status_title, status_desc, and status_icon. This means I will have 7 icons to represent the different status levels, a description, a title, a type (maybe yours could be ON or OFF duty for example), and the ID of the status.
    Another thing at this stage of development is that I don't make up my mind concretely about any of the data or how the data will fit together. I want to remain as flexible as possible, so that as my design develops, the design allows for the addition or subtraction of data and different data types to be created. In other words, I completely atomize all structure, associations, relationships, dependencies, or just anything in general that makes two or more pieces of information stick together.
    At this point, all I have is a loose bag of primitive data types with no structure whatsoever. Like I just tore up a piece of paper into a hundred pieces and threw into the air letting the pieces fall where they may.
    While I'm at this point, I will make decisions about which languages and platform would be the best to raise the beast. In my case, I chose to run it on the internet, so I chose MySQL to store the data, SQL to communicate to the DB, and the server uses a PHP scripting engine to spit out the HTML, also PHP lets me create OO classes very similar to a JAVA class. This is a very important step and must be made now, not later -- you don't want to do all this work only to find out that it should have been done in another language! Been there done that.
    Once I've decided all of the above, then I come back and decide how the data should be organized. NOW I make all the database TABLES. Then I write a class definition for each of the db tables. Each class will provide methods for saving, editing, and retrieving info to and from the db using SQL.
    Once I get to this point I will make FORMS for the easy entry of data. The FORMS, CLASSES and and db TABLES all mirror each other now, so the CLASSES handle all the info from FORM to DB, DB to FORM. Notice at this point I am still dealing with data and data flow, NOT the display of pretty information -- not even close.
    Ok, enough about this Sean, let me know if this helps any.</blockquote>
    This information was helpful, but also how I typically approach a large project.
    The only problem with what you talk about above is dealing with allowing "wiggle-room" for changing the data because the data that I'm storing is codified by the federal government through the CSA-2010 laws that regulate the trucking industry. Therefore, I really don't have any wiggle-room with the data at all.
    As for choosing Java over another language, I made this choice because I don't like limiting myself (or others) on what operating system they use and platform-independence is one of the best things about Java (provided you don't use any OS-specific code, which I try like hell not to do). I am a huge Linux guy, but have to use Windows to update my GPS and would like to be able to use this application no matter which OS I'm booted into. Just so you understand, I am fluent in multiple languages, including PHP, Java, Python, Ruby, C/C++, BASIC and Bash. I am also very big on OOP and always leave accessing the database to the class that holds that data (i.e., LogEntry class will access the database to store and retrieve the log data). I am also using MySQL as the database back-end, because it is the SQL server that I am most comfortable with and also has versions for various OSes. I use the mysql-connector.jar library for accessing MySQL from Java, so that's not even an issue.
    As for "static final" data in the database, I do store my statuses, with the status_id numbers the same as the row number on the hard-copy Driver's Daily Log books. These records simply hold the status_id and description (i.e., 1, "Off Duty").
    I believe that I've got the logic for logging an entry such as: 08:00-10:00, On Duty, Driving, status location Indianapolis, IN, comment: Tire check. This whole entry is on the same day and therefore fairly easy to graph. The type of entry that I'm having problems figuring the logic for is one where the last change of duty status was before midnight and the current change of duty status is after midnight, on the next day. For example, I typically stop for the night (my DOT 10-hour break) at 5:00 PM (17:00) and am in the sleeper across midnight, then get going at 3:00 AM (03:00). I'm having trouble figuring out how many hours to log on the current day. In the example that I just gave, I'm not getting how I can figure out when to start at midnight and when to start out at the prior status change time through code. Nothing that I try seems to work correctly and I keep getting horizontal status lines outside of my graph area.
    As for what data I need to store and how I need to store it, I am very flexible, except with the daily log data, since it is federally mandated. Once I figure out the logic for actually logging the statuses and changes of status properly, I will create the class for storing and retrieving the database data...for now I'm just using hard-coded times to get the graphing logic right without the overhead of database access. Changing this code to use the data from the database will be a snap in comparison to figuring out the graphing functionality.
    Thanks for your insights and assistance. I look forward to seeing what other ideas you have to share.
    Sean

  • I don't understand cropping

    I aways want to print 4x6 photos. When I crop a photo, I get a white area(s). How do I crop and still get a normal looking 4x6 that looks like any other 4x6?

    In the edit window, to the left of the "Crop" button is the "constrain" pull down menu. Click on that and choose 4x6. It will then show you what the cropped image will look like by adding the white, translucent border. If it looks okay, click the crop button and your done. The image is now in a 2:3 ratio that will give you a perfect 4x6.
    If you want to crop a little tighter, click on the white, translucent border. This will give you the cross hair tool back. Now click and drag around the part you want. As long as that constrain box still says 4x6, you will be okay. Then click on the Crop button to actually make the crop.
    After you upload to your online printer you can revert back to original if you don't want to keep the crop.
    bd

  • Best way to reduce a picture

    I have a 10.356 inch x 10.2 inch (180 ppi) (with no border) picture. I want to reduce it the best way for a standard 8 1/2 x 11 (with a small white border to print my name real small) for printing and framing.
    would appreciate some quick advise on the best way to do this (and create a small border) (ie increase canvas, then reduce image (resample or not?) etc).
    thanks in advance.
    Bob

    Here's what I had in mind (probably needs a few tweaks).
    Note that the "unintersting" rows are not even touched and everything operates in place.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    2Ddecimate.png ‏21 KB
    2Ddecimate.vi ‏10 KB

  • Can anyone help me to add method to rotate the image using mouse?

    Hi everyone, i am currently creating a game which require the user to be able to drag and rotate the image
    on the screen..but sadly...i'm only able to do the dragging part..
    Can anyone be able to help me add the method to rotate the image using the mouse?
    Thanks :-)
    the code
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    class Game extends JFrame {
         DisplayCanvas canvas;
         public Game() {
              super("My Game");
              Container container = getContentPane();
              canvas = new DisplayCanvas();
              TitledBorder border = new TitledBorder("Game Window");
              border.setTitlePosition(TitledBorder.BOTTOM);
              canvas.setBorder(border);
              container.add(canvas);
              addWindowListener(new WindowEventHandler());
              setSize(450,400);
              show();
              class WindowEventHandler extends WindowAdapter {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              public static void main(String arg[]) {
                   new Example();
         class DisplayCanvas extends JPanel {
              int x, y;
              BufferedImage bi;
              DisplayCanvas() {
                   setBackground(Color.white);
                   setSize(450,400);
                   addMouseMotionListener(new MouseMotionHandler());
                   Image image = getToolkit().getImage("duke.gif");
                   MediaTracker mt = new MediaTracker(this);
                   mt.addImage(image, 1);
                   try {
                        mt.waitForAll();
                   catch (Exception e) {
                        System.out.println("Exception while loading image.");
                   if (image.getWidth(this) == -1) {
                        System.out.println("***Make sure you have the image "
                        + "(duke.gif) file in the same directory.*****");
                        System.exit(0);
                   bi = new BufferedImage(image.getWidth(this),
                   image.getHeight(this),
                   BufferedImage.TYPE_INT_ARGB);
                   Graphics2D big =bi.createGraphics();
                   big.drawImage(image, 0, 0, this);
              public void paintComponent(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   g2D.drawImage(bi, x, y, this);
              class MouseMotionHandler extends MouseMotionAdapter {
                   public void mouseDragged(MouseEvent e) {
                        x = e.getX(); y = e.getY();
                        repaint();

    research a bit on AffineTransforms. you can set the rotated instance of the Graphics2D class and it will do the rotations for you :-D

  • What is the proper image size for ipad

    Hi all,
    I'm having trouble with photos on my ipad.
    First let me ask, What is the best size and dpi to display images?
    When I put a white stroke around the images i uploaded the stroke does not show on the right side of the images. So I created a white border using the "canvas size" tool in photoshop and still no border on the right side.
    Any help will be appreciated,
    Richard

    If you sync your photos with iTunes it will optimize them. Just place your photos at the full resolution in your folder (on your computer) that you are syncing and iTunes will take care of the size. My photos are all around 4000x3000 and they get reduced to 2048 on the long side. This allows you to zoom into the photo on the iPad (double tab a photo). But again, iTunes does all that for you. Just use them at full resolution.
    If you want to save space you can resize your photos to 1024 on the long side. I recommend to crop your photos at a 4x3 ratio to match the iPad screen. The DPI setting are meaningless. DPI is an arbitrary definition and has no effect on how the iPad shows your files.

  • Crop Against subject, removing background?

    I need to paste this column on a colored background, but the rectangular border of the canvas around the column is white, so the pasted overlay shows a white rectangle instead of just the column.  How do I remove the rectangular background, so that I am left with just the column that when I paste it on the colored background only the column will be visible?
    I tried using the Magic Wand, which makes a selection around the column, but I don't know what to do next...or if this is indeed the correct tool for the job.
    This is a process I never learned using PSE8.  Thank you for your help!

    My first choice would be the quick select tool. Wand, however, should also do the job.
    1. I'd select the white background around the column as it will be the easiest to select.
    2. To get the column selected, go to the menu bar and click Select<Invert Selection. Now, the column is selected.
    3. With your selection active, go to the menu bar and click Select<Refine Edge. Use the the sliders in Refine Edge to modify the selection if needed.
    4. After you are happy with the selection, press ctrl + J if on a PC or cmd + J if on a Mac. This command will lift a copy of the selected object (the column) onto it's own layer.
    5. Click the background layer eye in the layer's palette to make the original column image invisible. Once this is accomplished, you should see the column over transparency.
    6. Now, you can create a blank layer and move it under the column. Fill it with a solid color with the paint bucket. (Alternately, you could create a solid color fill adjustment layer and set it to the desired color. You could have also added a pattern or inserted a new background).
    Note: When an image is dragged or copied into another document it adopts that document's resolution. When images differ in resolution, they shrink or enlarge when they attempt to match that resolution.
    6a. You can also copy/paste or drag the isolated column layer into another document. (Keep in mind that anything dragged or copied into a document will adopt that document's resolution.)
    Note: If you want to keep the document in layers, save the document in a format like PSD that supports layers. JPG does not and will flatten the image...transparency areas will become white.
    Optional: If you want to save your column selection, go to the menu bar and click Select<Save Selection.  Name the selection. This will save the selection with the document in an alpha channel. Elements can not access the alpha channel directly so you can not view the selection, however, you can load a saved selection at any time by clicking Select<Load Selection. To preserve this saved selection with the document, the document must be saved in a format such as PSD that supports layers and preserves alpha channels...JPG does not. Any image saved as a JPG will be flattened and the alpha channel with the saved selection will be lost.

  • Quicktime X Problem List

    Mostly QTX but a few from the "new" QT7.
    • You can't set In and Out points
    • You can't Trim the middle of a video out.
    • The interface obscures the video. The title bar covers the top of the image and the floating controller can't be moved outside the window.
    • Adjusting the volume via the keyboard brings up the interface.
    • Pausing the video keeps the interface onscreen. Not helpful for screenshots.
    • Control Clicking the window removes the interface, allowing Command + Shift + 4, then Spacebar screenshots but moving the mouse returns the interface.
    • There is no Export to Still option for a frame of video.
    • There are no Preferences!
    • QTX seems to be unable to play DV video while QT7 can.
    • J, K, L controls are not working (system error beep will sound) at all in QTX
    • Option Clicking (maybe it was Command) does not play the video in reverse.
    • Option-Dragging a window does not alter it's size incrementally. Now you must use Command (plus) or (minus).
    • Shift-Dragging a window does not alter it's aspect ratio.
    • The player's title bar and file name are always on screen (unless you know to Control-Click) and will cover the Mac's Menu bar in the video if you make a screen recording. Bad for pausing and trying to see what menu item is being used. (see: http://1.bp.blogspot.com/_l0hI1EtS288/Sp1nDtebsGI/AAAAAAAABEY/Dl-AeJb-xR0/s1600- h/QTXTitlebarFail.png)
    • There are no buttons to go to the beginning or end of a video.
    • All of QT7's (pro) capabilities are available to other apps, like the pro app series but QT X does not have access to them.
    • While it's exporting some people say you can't even use QT7 at all for other functions.
    • QT7 will only allow one export at a time.
    • The floating controls will not scale along with the video, so when the video is small, the controls obscure a large part of the video. Bad for subtitles.
    • The floating controller and title bar are shown when you start playing a video. There's no option to never show them.
    • QTX apparently can't play multiple videos at once? (didn't test)
    • Show Movie Properties is gone.
    • Minimum video playback size is something like 478x359. Smaller videos are scaled up and fuzzy.
    • QTX has issues opening SMIL files?
    • QT7 is hidden in the Utilities folder and you must assign it as the default Open With app if you need it's functionality.
    Feel free to add any others. And please let Apple know.
    http://www.apple.com/quicktime/feedback/
    Message was edited by: W. Raider

    If I save a movie with a text track (created in pre-Quicktime X) and play it back in Quicktime X, the movie is larger than the previously saved movie. 344 x 338 becomes 478 x 471 and I can't make it any smaller.
    As someone else pointed out, but I just wanted to emphasize, any subtitles/captions will obscured for the first few seconds while the user frantically tries to move the controller out of the way or waits for it to disappear. Doesn't have to be captions ... what if the text is part of the video, or the video has content that just shouldn't be obscured?!
    The scrubber is tied into the disappearing controller It ought to be a choice to hide the scrubber and the scrubber itself should be built into the border of the canvas. So many users have come to rely on the scrubber conveying information about the current time of a movie as well as how far along they are.
    SMIL is missing in this release.
    There's no clear statement of what is returning from the missing list and when.
    Why, with so many missing things and the need for continuity with all those Quicktime files that aren't supported with Quicktime X is Quicktime 7 a mere "optional" install? Or, why was Quicktime X even released at this point?
    I've been a Quicktime advocate for just about forever and actually found myself considering, gasp, Flash for some of what I do.

  • Quicktime in FCE

    My son is making a movie in FCE and has a few QT movie from a friends digaital camera. When we play them in FCE they are small in size not full screen. Is there a way to convert them to full screen and keep the quality?
    Thanks for all you help..

    As a suggestion you could try scaling a copy of the footage to full screen then use filters and opacity to give it translucent border style look and use the original at original size playing in centre screen.
    What you see is a PIP (picture in picture).
    Al

  • Shap drawn in applet couldn't see in Browser

    shap drawn in applet couldn't see in Browser but could see in applet-viewer
    why it happen?
    here is the code :
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import java.awt.geom.*;
    * GeneralPath shape rendered .
    public class ShowTest
        extends JApplet {
      ArrayList groupList, lineList;
      MapCanvas canvas;
      public void init() {
        Container cp = getContentPane();
        BorderLayout bord = new BorderLayout();
        cp.setLayout(bord);
        cp.add(canvas = new MapCanvas(this), "Center");
        JPanel commandPanel = new JPanel();
        JButton connectServlet = new JButton("connect-Servlet");
        commandPanel.add(connectServlet);
        cp.add(commandPanel, "North");
        File file = new File("c:\\Landlock.txt");
        groupList = new ArrayList();
        double p[] = new double[2];
        StringTokenizer st;
        try {
          int count;
          String s;
          FileInputStream fin = new FileInputStream(file);
          InputStreamReader isr = new InputStreamReader(fin);
          BufferedReader br = new BufferedReader(isr);
          for (; (s = br.readLine()) != null; ) {
            lineList = new ArrayList();
            st = new StringTokenizer(s);
            count = Integer.parseInt(st.nextToken());
            //System.out.println(count);
            for (int i = 0; i < count; i++) {
              s = br.readLine();
              st = new StringTokenizer(s);
              for (int j = 0; j <= st.countTokens() && st.hasMoreTokens(); j++) {
                p[j] = Double.parseDouble(st.nextToken());
              lineList.add(new Point2D.Double(p[0], p[1]));
            groupList.add(lineList);
        catch (Exception e) {
          e.printStackTrace();
    class MapCanvas
        extends Canvas {
      ShowTest applet;
      //change condition
      int m_nXLeft, m_nYTop;
      int m_nXRight, m_nYBottom;
      //change condition
      double m_nLXLeft = 0, m_nLYTop = 90;
      double m_nLXRight = 360, m_nLYBottom = -90;
      public MapCanvas(ShowTest app) {
        applet = app;
        setBackground(Color.yellow);
      BufferedImage img;
      public void update(Graphics g) {
        paint(g);
      public void paint(Graphics g) {
        m_nXLeft = getLocation().x;
        m_nYTop = getLocation().y;
        m_nXRight = m_nXLeft + getSize().width;
        m_nYBottom = m_nYTop + getSize().height;
        System.out.println("m_nXLeft " + m_nXLeft);
        System.out.println("m_nYTop " + m_nYTop);
        System.out.println("m_nXRight " + m_nXRight);
        System.out.println("m_nYBottom " + m_nYBottom);
        Graphics2D g2;
        int width = getSize().width;
        int height = getSize().height;
        img = (BufferedImage) createImage(width, height);
        g2 = img.createGraphics();
        g2.clearRect(0, 0, width, height);
        ArrayList lineList, group = applet.groupList;
        Point2D.Double pPoint;
        Point lpFirst = new Point(), lpSecond = new Point();
        GeneralPath p = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        p.moveTo(33, 18.0f);
        p.lineTo(46.0f, 90.0f);
        p.lineTo(55.0f, 12.0f);
        p.lineTo(200.0f, 100.0f);
        p.lineTo(300.0f, 200.0f);
        p.closePath();
        g2.draw(p);
        g2.drawRect(101, 101, 100, 100);
        int size = group.size();
        GeneralPath coastPath;
        System.out.println("group.size()" + size);
        for (int i = 0; i < 1; i++) {
          coastPath = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
          lineList = (ArrayList) group.get(i);
          pPoint = (Point2D.Double) lineList.get(0);
          //System.out.println("pPoint.x"+pPoint.x+"pPoint.y"+pPoint.y);
          LoToPh(pPoint, lpFirst);
          coastPath.moveTo(lpFirst.x, lpFirst.y);
          //System.out.println("lpFirst.x " + lpFirst.x + " lpFirst.y" + lpFirst.y);
          //System.out.println("lineList.size() " + lineList.size() );
          for (int j = 0; j < lineList.size(); j++) {
            pPoint = (Point2D.Double) lineList.get(j);
            LoToPh(pPoint, lpSecond);
        coastPath.lineTo(lpSecond.x, lpSecond.y);
            System.out.println("lpSecond.x " + lpSecond.x + " lpSecond.y" + lpSecond.y);
          if (lpFirst.x == lpSecond.x && lpFirst.y == lpSecond.y) {
            coastPath.closePath();
          g2.draw(coastPath);
          g2.dispose();
        g.drawImage(img, 0, 0, null);
      public void LoToPh(Point2D.Double pp, Point lp) {
        //make some change
        double latitude = pp.x;
        int temp = (int) ( ( (latitude - m_nLXLeft) * (m_nXRight - m_nXLeft)) /
                          (m_nLXRight - m_nLXLeft));
        lp.x = temp + m_nXLeft;
        //System.out.println("lp.x"+lp.x);
        //make some change
        double longtitude = pp.y;
        temp = (int) ( ( (m_nLYTop - longtitude) * (m_nYBottom - m_nYTop)) /
                      (m_nLYTop - m_nLYBottom));
        lp.y = temp + m_nYTop;
    }

    Your IDE has an applet viewer that uses a JRE not available to the browser. If you're using MSIE, there's a built-in java 1.1 (yeah, one point one) runtime. You've just opened a real can of worms. See the article Launching Applets for an introduction.
    http://www.MartinRinehart.com

Maybe you are looking for