Moving to a particular line in a BufferedReader

Hi,
I have a bufferred reader that reads lines of text from a file. I would like to move to a particular line in the file. Is there any way to do so?
My simple code is below. I am familiar with reading text files, but I have an operation that I would like to move to particular lines in the file.
String curLine;
while(((curLine = this.rtReader.readLine()) != null)
}

As long as you can live with moving forward only you
can use LineNumberReader
http://java.sun.com/j2se/1.5.0/docs/api/java/io/LineNum
erReader.htmlNote that this class requires that the file be read starting at the beginning - it keeps track of the line numbers. (Of course, that is easy to do with a counter, yourself.)

Similar Messages

  • To Set Goods Receipt Indicator For Particular Line Items In SRM

    Hi All,
      i am working on BBP_DOC_CHANGE_BADI in SRM. i am trying to set the goods receipt indicator for particular line items based upon certain conditions. The values are being set in the badi. But when the Purchase Order is created in the backend R/3 i coudn't able to find the goods receipt indiactor being set..
    i used this field to set the GR indicator
      GR_IND = 'X'.  " Goods Receipt Indicator
    Can anyone help me in this?
    helpfull answers will be rewarded....
    Thanks,
    Murali

    To Murali and Christophe,
    I have set the GR and GR non val indicator in CREATE_PO BADI but I face the following situation :
    problem -
    In case of multiple account assignment in the shopping cart, the R/3 transaction ME21N sets these flags. 
    The flag status determined as per EBP conditions is lost.
    I need to retain the flag status as per EBP conditions even in this multiple account assignment scenario.
    proposed solution -
    - CREATE PO badi is already implemented in EBP and customised logic for GR and GR non valflag is in place.
    - I create user exit in R/3 backend system in ME21N transaction 
    - I make RFC call in this user exit to EBP and check the table BBP_PDPSET for the shopping cart.
    This is how I get the flag status as per EBP conditions and copy the same to R/3 thereby overriding the multiple account assignment check of the R/3 system.
    issue - 
    When I tried to verify that I can check the BBP_PDPSET table from R/3, I found that this table is not having entries for all the records in  CRMD_ORDERADM_I table.
    For which shopping carts will the BBP_PDPSET table not  be populated ?
    thank you in advance,
    Bhakti.

  • How to delete and edit particular line in a file and save it in same file ?

    Hi,
    I want to delete and edit text at particular line in a file.
    But edit and delete should reflect in same file.
    I have done googling for this but it results with using another file, that i dont want as i need to save changes in same file.
    How can i do this?
    Thanks in advance
    Edited by: vj_victor on May 24, 2010 3:33 PM

    I just want to make sure, this is the only way to do what i mentioned ? or it could be done another way !a) write the data to a new file
    b) delete the old file
    c) write the data to a newer file
    d) delete the new file
    e) rename the newer file to the old file name.
    For a hint about still more ways to do this, search for the complete lyrics of One man went to mow, Went to mow a meadow...
    db

  • How to highlight the whole row of a particular line item of sale

    How to highlight the whole row of a particular line item of sales order depending on condition?
    Please help its urgent..
    Looking forward your reply.
    Moderator message: please do more research before asking, show what you have done yourself when asking, do not flag posts as "urgent".
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 9, 2011 9:30 AM

    Any ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
    MyTableModel modelS = (MyTableModel)dataModel.get("S");
    jTable1 = new JTable(modelS);
    jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
    class MyTableModel extends DefaultTableModel {
      public MyTableModel(Object[] columnNames, int numRows) {
        super(columnNames, numRows);
      public boolean isCellEditable(int row, int column) {
        if (TableKey == 'S') {
          if (column == 6) {
            return false;
        if (TableKey == 'O') {
          if (column == 0 || column == 4 || column == 5) {
            return false;
        if (TableKey == 'P') {
          return false;
      return true;
    }Can anyone help? Thanks.
    Allyson

  • Payment terms  for particular line item

    Hi gurus
    i have defined payment terms and assigned to customer master, when ever i am creating sales order payment terms are getting in the sales order if i want to change the payment terms for particular line item what is need to be done
    please let me know asap
    thanks n regards
    srinvias

    Hi,
    There are few ways:
    - You need to check in respective Item Category, the field "Business Item data" should be unchecked, this will allow you to change the Payment Terms at Item Level.
    -Even if the above settings are not being done, you can have the Payment terms fetched from Condition record maintained for that item. Mind that you need to maintain the Payment terms in Condition Records of the pricing of the item.
    Do reward answers with suitable points.
    Regards
    SD

  • How to read the particular line in a file !!!

    i want to read the 5th , 8th or some other line number of the file. This file is consists of many data arranged by line number. I'm able to retrieve the LineNumber of the file but i'm not able to point the curser to that particular line so it can read that line only.
    i'm pointing the cursor to that particular linenumber as in.setLineNumber(5) it moves to that particular line but after that when i try to read that particular line i'm not able to read that line.
    could any one tell me which is the other way to read that particular line or in this only where i'm doing wrong...
    i need this urgent....

    As is typical of people who claim their problem is urgent, you posted this in the wrong forum (it doesn't have anything to do with JSP) and you left out any details that might help us understand what you are blathering about.
    So take a deep breath. It isn't urgent. There is no rush. Now formulate a proper description of your problem and post it in the proper forum.

  • How to visualiza just particular lines in InfoView report

    Hi, I'd like to know how to visualize in InfoView report  that contatin following variables ="ID, TypeNUM, Value"
    just lines that have populate TypeNUM with the Maximium value for single ID like in the following example:
    Starting table
    ID     TypeNUM  Value
    001         50       1000
    001       100         500
    002         60         750
    003         50       1000
    003       120       1000
    003         30         500
    Result:
    ID     TypeNUM  Value
    001       100         500
    002         60         750
    003       120       1000
    thank you in advance

    Hi Dennis,
    We got it.We need to use below code when we want to delete a particular line in between the column headers.
    Thanks for ur inputs
    #__column1{
    border-left: none !important;
    #__column0
      border-right: none !important;

  • Wanted particular line item to be billed directly after delivery

    I came across a situation where my client wants particular line item to be billed after delivery.  Say, there are other line items too which are delivered.   How to configure this in system?

    Hi,
    First thing is if the invoice is to be created after delivery directly before PGI then you will have to configure this in following way.
    In VTFL at item level assign requirement 011(Invoice before PGI)
    This will ensure that the Invoice is created before PGI.
    Secondly for a delivery related billing a particular item is to be billed has to be find out by system? which is not possible. This bussiness decision has to be taken by user.
    What he can do is the item for which he think billing is not to be done...he should apply item level billing block for those items in delivery.
    For the remaining items a background job for invoice creation should be scheduled at suaitable time interval so the invoices will be created.
    Reward points if useful
    Regards,
    Amrish Purohit

  • Discount not required for a particular line item in PO

    Hi All,
      There is one requirement wherein PO contains 500 line items, in which discount should not be applicable to a particular line item , whereas all the other line items should consist of discount.
      Making a separate PO for that particular line item(Having no discount) is not agreeable.
      If we put the discount condition type at header level, it'll be applicable to all line items. But requirement is that, discount should not be applicable for  particular line items.
    Putting discount condition type to all the line items (Item Level) except a few, is also not agreeable, as it is a manual entry of 490 line items & its not recommended.
    Please suggest asap.
    Thanks

    hi Mahesh,
    As you said there are 500 line items in you document and for 1 line item you don't want to give discount and also don't want to creat another seprate document
    You have to create seprate document for that one item as in once document you can have MAXIMUM 499 line items
    This is because for every line item there will be 1 Debit and 1 Credit entry in FI, but in 1 FI document you can have only 999 line items so in your document you can have maximum 499 items
    Second option is that, in M/06, in Changes Can Be Made Area, select tick on DELETE, and when you creating document, delet the condition for that Item
    Regards
    Vishal

  • Editable ALV - Particular Lines Display and Edit Problem

    Hi,
    I have developed a program which updates the Custom tables in the database.
    I am using cl_gui_alv_grid in the module pool program. I am making all the fields editable using ls_fcat-edit = 'X'.
    But as per my requirement in the change mode of the same data base entry, the user should not be able to change the existing data (like PO line items).
    My requirement is for a particular Purchase Order if there are line items, when I open the Purchase Order in the change mode all the existing line items should be in display mode and I need to provide the user to add more lines.
    Say the PO has 3 line items, in the Grid, it should be like all the existing 3 line items should be in display mode and rest of the lines should be in editable mode which will give the option for the user to add more line items for the same PO.
    Here it is not Purchase Order,  I just compared as an example.
    Logic I am using.
    I am building the internal table with a serial numbers from 1-99 and this particular column will be in display mode in the ALV Grid. Using the class cl_gui_alv_grid.
    Capturing all the data entered using event handler with method handle_data_changed.
    Please tell me how do I set the particular lines in display mode and others in editable mode within the same internal table.
    Thanks

    Hi Prabhu,
    thanks for the logic, but for some reason the it is not working for me.  Please see the below logic and let me know what I am missing.
    I am not passing anything related to style to the method Set table for first display.
    Is this correct  it_outtab            = gt_outtab[].
    or because of the below method
    CALL METHOD g_grid->set_ready_for_input the lines are not actually coming in display mode
    DATA : BEGIN OF gt_outtab OCCURS 0.
    INCLUDE TYPE zaodoperation.
    DATA: celltab TYPE lvc_t_styl ."--->for styles.....
    DATA: END OF gt_outtab.
    DATA ls_celltab TYPE lvc_s_styl .
      DATA lt_celltab TYPE lvc_t_styl .
      DATA v_tabix TYPE sy-tabix.
      IF gt_outtab[] IS NOT INITIAL.
    *Setting the non editiable mode
        LOOP AT gt_outtab INTO gs_outtab.
          IF gs_outtab-heatnum IS NOT INITIAL.
            LOOP AT gt_fieldcat INTO gs_fieldcat.
              ls_celltab-fieldname = gs_fieldcat-fieldname.
              ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled."-->no edit.....
              INSERT ls_celltab INTO TABLE lt_celltab.
            ENDLOOP.
            INSERT LINES OF lt_celltab INTO TABLE  gs_outtab-celltab.
            MODIFY gt_outtab FROM gs_outtab.
            CLEAR : gs_outtab.
    *      else.
    *        v_tabix = sy-tabix.
          ENDIF.
    *      delete gt_outtab INDEX v_tabix.
        ENDLOOP.
      ENDIF.
    CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          is_layout            = gs_layout
          it_toolbar_excluding = gt_exclude
        CHANGING
          it_fieldcatalog      = gt_fieldcat
          it_outtab            = gt_outtab[].
    * set editable cells to ready for input
      CALL METHOD g_grid->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
      CALL METHOD g_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    Thanks

  • Code has moved on to 1 line ??? Please help

    Hi Guys.
    For some reason, all of my code has moved on to 1 line. So I
    now have only 1 line of code instead of 500 lines of code.
    EXAMPLE
    [code]
    <?PHPinclude("dbconnect.php");include("Library/tracker.php");include("Library/Navi.php");i nclude("Library/top_banner.php");include("Library/call_to_action.php");include("Library/fo oter_links.php");include("Library/head.php");$tag
    = 'About BusinessMobiles.com';$url =
    'about_businessmobiles.php';$page = 'about';$sub = '';$num =
    '';$page_name = 'template2';?>
    [/code]
    It should be:
    [code]
    <?PHP
    include("dbconnect.php");
    include("Library/tracker.php");
    include("Library/Navi.php");
    include("Library/top_banner.php");
    include("Library/call_to_action.php");
    include("Library/footer_links.php");
    include("Library/head.php");
    $tag = 'About BusinessMobiles.com';
    $url = 'about_businessmobiles.php';
    $page = 'about';
    $sub = '';
    $num = '';
    $page_name = 'template2';
    ?>
    [/code]
    How do I get it back to the way that it was, as it's
    imposiable to edit like this.
    Thanks for your help.

    jeff spires wrote:
    > For some reason, all of my code has moved on to 1 line.
    So I now have only 1
    > line of code instead of 500 lines of code.
    Edit > Preferences > Code Format. Set Line Break Type
    to LF (Unix).
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Moving Red Gian Particular Plugin to CC

    I moved Red Giant Particular plugin from AE CS5 to AE CC by copying the subfolder from the CS5 plugin folder to the AE CC plugin folder.  Particular now works fine in CC.  However, the presets were not there.  So I also copied them.  They still don't work.  THE PROBLEM is now none of my CS5 Production Premium apps (e.g., PPro, Ps, etc) work and are requesting the serial number (or will let me use as a trial).  Before I go any further, what did I do wrong?  I would like to fully restore CS5 until all my preferences, plugins, and scripts have been sucessfully made to work in CC.

    Hi Todd
    I had the same issue because the preset packs need to be installed manually. This is what the RG tech people advised to get me up and running:
    1) Close all programs this includes your host application as well as other installers.
    2) Run the Guru Preset installer (one at a time) for CS6 installer.
    3) Finish installation
    5) Go to: C:\Program Files\Adobe\Adobe After Effects CS6\Support Files\Presets (or MacHD/Library/Application Support/Adobe/Adobe After Effects CS6/Support Files/Preset)
    6) Move the appropriate preset folder to the following location:  C:\Program Files\Adobe\Adobe After Effects CC\Support Files\Presets (MacHD/Library/Application Support/Adobe/Adobe After Effects CC/Support Files/Preset)
    7) Re-launch AE CC, the presets should now be available.
    If you find that they are not showing up, please make sure you have the animation presets turned on. The RG FAQ on how to do so is here: http://www.redgiant.com/support/faq/product-specific/trapcode-particular/170/
    I hope this helps.
    Regards,
    Graham

  • Premiere Elements 10 - Moving Pictures to Time Line

    Have version 10 and no manual is available yet, so a simple question im sure.
    I have say 100 pictures that I want to move into my movie, making a slide show of sorts.
    Is there a way to move them all and set the time (or number of frames) that each picture is shown.
    So select all 100 pictures and move to time line and set the time to display each one to 1 second as example.
    Is there a way to select multiple pictures on the time line and set them all to be shown for a specific time.
    I know that a silgle item can be selected on the time line and manualy dragged to make it a specifice time,
    but can this time be entered by entering a time/frames value?  I'd like to change the time on all 100 at the same time.
    My objective is to make a fast moving slide show from pictures, being able to set the on screen time for each one to
    the same value, all at once, not having to select each one on the time line and manually adjust it picture by picture.
    Dave

    Sure is.
    First, before you load the photos into Premiere Elements, go to Edit/Preferences and set the duration for each still. You must do this before you import your pictures because it only affects stills added after you make this change.
    Then, before you bring your pictures in, open them in a program like Photoshop Elements and make sure they are all no larger than 1000x750 pixels. Photo Elements has a batch change feature under the File menu called Process Multiple Files.
    Then use Get Media/From Files and Folders and bring your pictures into your project. If you've got them named in alpha numeric order, they'll appear in the Media panel in the right order and you can grab them all at once and drag them to the timeline. Voila!
    All of this and more is in my books, by the way -- for better or worse, the ONLY manuals for Premiere Elements and the Photo Elements/Premiere Elements combo (aside from Adobe's Classroom in a Book). You can read about it and see some walk-throughs of its new features here:
    http://Muvipix.com/pe10.php

  • Moved home. New line constant engaged tone and can...

    I moved home last Monday and organised a BT phone line move from my old property to the new one a few weeks prior. I said I did not mind if the phone number changes as I don't use the phone line for calling anyway. I only have it for the sake of broadband.
    So I was told by BT the phone line at my new property should be ready last Friday. Well I tried plugging my phone into the phone socket and all I get is the sound of a constant engaged tone. I cannot make any calls from this. I tried dialling numbers but the engaged tone persists, as if nothing has changed at all. 
    I even unscrewed the BT socket panel to connect my phone to the main test socket and still, the same persistent engaged tone. No different than before.
    Called BT about this and they did a line test and said they could not detect a problem with the line from their end. They said they could send an engineer out but kept giving me a warning that if they send an engineer down here it will cost me £129.99 if it is not BT's fault. They said it could be fallen trees on my end or whatever, and in that case I would be charged. I really don't think it could be fallen trees as I live near the city centre in a mid terrace Victorian house with paved backyard and all my neighbours too have paved yards. There is not a single tree around here growing in anybody's yard. 
    Anyway I decided I'd rather have an engineer see to this than be forced to pay the monthly £29 ish charge to BT for a broadband service I cannot use because of the line being the way it is. So booked an engineer to come yesterday. They said he'd come between 1 - 6 pm. And they kept telling me NOT to call them again regarding this issue. Well the engineer never showed up. At about 5 pm BT called me to say there is a problem with the booking system and said they will rebook another engineer appointment for me today. Said the engineer will come between 8 am  - 1 pm. And once again she finished off by telling me NOT to call BT back about this. Well it's past 11 am now and still no sign of any engineer. 
    Not very happy about this... Sigh.
    Does anyone know what could be going on with my phone line? 

    Please contact NeilO  as requested.
    Make sure that you are logged into the forum, then click on his name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    For your own security, do not post any personal details, on this forum. That includes any tracking number you are give.
    This is the form you should see when you click on the link. If you do not see this form, then you have selected the wrong link.
    When you submit the form, you will receive an enquiry number, so please keep a note of it
    I would imagine its probably an exchange configuration fault, which should not require a visit. Its quite normal for the Field Technician to visit the excahnge first, and test on the frame.
    You may find that the fault will be cleared within a few hours, once the equipment is sorted.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Problem!!! Moving point along the line

    hi,
    I need to move the point along the line. I want move this point using mouse.
    My program draws a line and a point that' s on this line.
    Could someone help me.

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class TraverseAgain extends JPanel {
        Point2D.Double[] points;
        Point2D.Double p1;
        Point2D.Double p2;
        /** An endPoint of one of the lines is being moved. */
        public void setEndPoint(int index, double x, double y) {
            int start;
            double ratio;
            switch(index) {
                case 0:
                    start = index == 0 ? 1 : 0;
                    ratio = getRatio(p1, start, index);
                    resetMidPoint(p1, points[start], x, y, ratio);
                    break;
                case 1:
                    start = index == 0 ? 1 : 0;
                    ratio = getRatio(p1, start, index);
                    resetMidPoint(p1, points[start], x, y, ratio);
                    start = index == 1 ? 2 : 1;
                    ratio = getRatio(p2, start, index);
                    resetMidPoint(p2, points[start], x, y, ratio);
                    break;
                case 2:
                    start = index == 1 ? 2 : 1;
                    ratio = getRatio(p2, start, index);
                    resetMidPoint(p2, points[start], x, y, ratio);
                    break;
                default:
                    System.out.println("illegal index: " + index);
            points[index].setLocation(x, y);
            repaint();
         * Design assumption/decision:
         * Preserve this ratio when repositioning a midPoint between the
         * end points of its line when one of the end points is being moved.
        private double getRatio(Point2D.Double p, int start, int end) {
            double d1 = points[start].distance(p);
            double d2 = points[start].distance(points[end]);
            return d1 / d2;
        private void resetMidPoint(Point2D.Double p, Point2D.Double end,
                                   double x, double y, double ratio) {
            double dy = y - end.y;
            double dx = x - end.x;
            double theta = Math.atan2(dy, dx);
            double length = end.distance(x, y);
            x = end.x + length*ratio*Math.cos(theta);
            y = end.y + length*ratio*Math.sin(theta);
            p.setLocation(x, y);
        /** A midPoint is being moved. */
        public void setMidPoint(int number, double x, double y) {
            switch(number) {
                case 1:
                    double dx = points[1].x - points[0].x;
                    double dy = points[1].y - points[0].y;
                    if(points[0].x < x && x < points[1].x ||
                       points[1].x < x && x < points[0].x)
                        y = points[0].y + (x - points[0].x)*(dy / dx);
                    else if(points[0].y < y && y < points[1].y ||
                            points[1].y < y && y < points[0].y)
                        x = points[0].x + (y - points[0].y)*(dx / dy);
                    else
                        return;
                    p1.setLocation(x, y);
                    break;
                case 2:
                    dx = points[2].x - points[1].x;
                    dy = points[2].y - points[1].y;
                    if(points[1].x < x && x < points[2].x ||
                       points[2].x < x && x < points[1].x)
                        y = points[1].y + (x - points[1].x)*(dy / dx);
                    else if(points[1].y < y && y < points[2].y ||
                            points[2].y < y && y < points[1].y)
                        x = points[1].x + (y - points[1].y)*(dx / dy);
                    else
                        return;
                    p2.setLocation(x, y);
                    break;
                default:
                    System.out.println("illegal number " + number);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(points == null)
                initGeoms();
            g2.setPaint(Color.blue);
            for(int j = 1; j < points.length; j++)
                g2.draw(new Line2D.Double(points[j-1].x, points[j-1].y,
                                          points[j].x,   points[j].y));
            g2.setPaint(Color.red);
            for(int j = 0; j < points.length; j++)
                mark(points[j], g2);
            g2.setPaint(Color.green.darker());
            mark(p1, g2);
            mark(p2, g2);
        private void mark(Point2D.Double p, Graphics2D g2) {
            g2.fill(new Ellipse2D.Double(p.x-2, p.y-2, 4, 4));
        private void initGeoms() {
            int w = getWidth();
            int h = getHeight();
            points = new Point2D.Double[3];
            points[0] = new Point2D.Double(w/4, h/3);
            points[1] = new Point2D.Double(w/16, h/2);
            points[2] = new Point2D.Double(w*13/15, h*3/4);
            double cx = points[0].x + (points[1].x - points[0].x)/2;
            double cy = points[0].y + (points[1].y - points[0].y)/2;
            p1 = new Point2D.Double(cx, cy);
            cx = points[1].x + (points[2].x - points[1].x)/2;
            cy = points[1].y + (points[2].y - points[1].y)/2;
            p2 = new Point2D.Double(cx, cy);
        public static void main(String[] args) {
            TraverseAgain test = new TraverseAgain();
            PointMover mover = new PointMover(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class PointMover extends MouseInputAdapter {
        TraverseAgain traverseAgain;
        int selectedEndIndex = -1;
        int selectedMidNumber = -1;
        Point2D.Double offset = new Point2D.Double();
        boolean dragging = false;
        final int MIN_DIST = 5;
        public PointMover(TraverseAgain ta) {
            traverseAgain = ta;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            Point2D.Double[] points = traverseAgain.points;
            for(int j = 0; j < points.length; j++) {
                if(points[j].distance(p) < MIN_DIST) {
                    selectedEndIndex = j;
                    rigForDrag(points[j], p);
                    break;
            if(selectedEndIndex == -1) {
                if(traverseAgain.p1.distance(p) < MIN_DIST) {
                    selectedMidNumber = 1;
                    rigForDrag(traverseAgain.p1, p);
                } else if(traverseAgain.p2.distance(p) < MIN_DIST) {
                    selectedMidNumber = 2;
                    rigForDrag(traverseAgain.p2, p);
        private void rigForDrag(Point2D.Double p, Point loc) {
            offset.x = loc.x - p.x;
            offset.y = loc.y - p.y;
            dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
            selectedEndIndex = -1;
            selectedMidNumber = -1;
        public void mouseDragged(MouseEvent e) {
            if(dragging) {
                double x = e.getX() - offset.x;
                double y = e.getY() - offset.y;
                if(selectedEndIndex != -1)
                    traverseAgain.setEndPoint(selectedEndIndex, x, y);
                else
                    traverseAgain.setMidPoint(selectedMidNumber, x, y);
    }

Maybe you are looking for

  • Blue Screen crash in Windows 7: culprit is ntkrnlmp.exe

    Hi, I've been, with increasingly frequency, getting crashes on my Windows 7-run Gateway.  Here's what I see when I run the WhoCrashed program (I'm very computer illiterate, sorry!): On Wed 1/22/2014 11:34:06 PM GMT your computer crashed crash dump fi

  • How to create a Desktop based reporting tool

    Regarding the Rreporting tool . Here I am mentioning the key points of my requirement, As a first step the user creates the table linking and Alias naming. Need a GUI kind of reporting tool, Where the user can drag and drop the tables, In that he can

  • Adobe PP CS6 Crashes Constantly! PLEASE POST A SOLUTION.

    Adobe PP constantly crashes. Counted over 100 today! It freezes shortly after or during the loading of the project assets. At times when it does load, performance is nightmarishly slow. Simple commands takes minutes to be performed but it hangs short

  • Additional field(company code) in purchase order screen layout

    Hi All experts, I have a requirement to set the company code in Purchase order as display field during PO creation or change. I have checked in IMG under screen layout for purchase order but  there is no company code field available. How can I add th

  • (SPAM) getting about 100 connections per minute

    Hi guys: lately my mail server is getting jammed with requests to send email to [email protected] They necer stop and the requests come from all over the world. I cannot find any information by doing a google search. Has anyone experianced anything l