Best swing class choices for overlaying instruments/marker data on map?
Hi everyone. The title pretty much says it all.
I'm looking for some insight into how to draw things correctly so I don't get glitches. This is a nautical GPS application. Right now I have the following classes:
MapView extends JPanel
VectorMap (standalone class)
InstrumentOverlay extends JPanel
BoatOverlay JPanel
GPSGridOverlay (standalone class)
MapView is simply a place to consolidate the drawing of everything. VectorMap is actually the data storage object for a series of contour lines and geographic points with associated text labels. GPSGridOverlay and InstrumentOverlay are things that will overlay and possibly move around on top of the map. When I drag my InstrumentOverlay around, it smears any other overlayed data (like the BoatOverlay or GPSGridOverlay). It doesn't smear the background map. I can only fix it by manually calling repaint on MapView. I can post a screenshot if that would help.
My question is, am I doing this in a silly manner? What would be a better choice of Swing classes for this task? Is it alright to use standalone classes as I have done and pass them a Graphics object to paint into, or should they be made into Swing class objects like JPanels?
the paintComponent method of my MapView object is:
protected void paintComponent(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
// clear screen
g2D.setColor(new Color(255,255,255));
g2D.fillRect(0,0,getWidth(),getHeight());
// manually paint components that aren't JPanels
vectormap.draw(g2D);
gpsgridoverlay.draw(g2D);
// JPanel children (instrument, boat) will paint automatically after this due to
// paintChildren() call made by swing.
}
Here are some screenshots:
before dragging compass:
http://www.kulkarnicorp.com/coastnav1.jpg
after dragging compass to the left in an S pattern:
http://www.kulkarnicorp.com/coastnav2.jpg
Similar Messages
-
Class VIs for access to private Data: reentrant or not?
I just created in a class some VIs for access to private data (my German translation). I'm talking about these VIs, which enable you to connect your class object to a property node to read or write private class data. These VIs are by default non-reentrant. My question is: what happens, if I try to access two objects of the same class with these property nodes? Does the second object have to wait for the first one to be read? If yes, can I circumvent this by making these VIs reentrant?
Regards,
Marc
CLD
Solved!
Go to Solution.In theory yes. In pratice it will depend on what you are doing in the private method and the methods it calls.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Best External LCD choice for my PB G4
Hello,
Anybody can tell me what is a good 20"/21"/22" lcd for my PB 1.5 15" (Al) ?
I see the max resolution for the external monitor is 2048x1536... That's true???
Thank You to All.
Fabio.
(http://www.everymac.com/systems/apple/powerbookg4/stats/powerbook_g4_1.515.html)Also look into the higher end Dell monitors (any model that doesn't start with an E or SP). Cheaper than the Apple Cinema Displays with more features, better backlight uniformity, colour balance, and more. I got the 2407WFP-HC for $650 and don't regret a moment of it. Out of the box it provides great colour, and even better once calibrated. There's a 5-in-1 card reader, 4 port USB hub, DVI, VGA, Component, Composite, and S-Video inputs. Comes on a height adjustable stand with tilt and swivel. Easy to use menu systems too. Similar features are available on 20, 22, and 27-inch models.
2048x1536 is using the VGA adaptor for an analog connection. Using the DVI connection, you can power a monitor up to 1920x1080 digitally.
Good luck! -
What are Best CAMCORDER option/choice for APPLE MAC
Just looking around for a compatible CamCorder ie Apple O/S software provided with the Cam Corder. Looking at HDD Storage recorder, however not necessary to go to the higher level. Any advice would be greatly appreciated.
healed
-
Hi
id like to do something similar to this
www.pininthemap.com
As a basic starting point
Id like to have a world map graphic where anyone can add a flag to a location on the map and then type a comment which will be linked to that flag.
Users can view the map with all the added flags on and choose to read the comments by clicking an existing flag.. and then hopefully add there own flag for their location and write a comment.
I understand this might be quite difficult as i dont have any advanced programming experience (only actionscript 2.0). But im really not sure where to start or how this can be done.
Does anyone have any ideas?
thanks allot in advance.Abe2 wrote:
Hi
id like to do something similar to this
www.pininthemap.com
As a basic starting point
Id like to have a world map graphic where anyone can add a flag to a location on the map and then type a comment which will be linked to that flag.
Users can view the map with all the added flags on and choose to read the comments by clicking an existing flag.. and then hopefully add there own flag for their location and write a comment.
I understand this might be quite difficult as i dont have any advanced programming experience (only actionscript 2.0). But im really not sure where to start or how this can be done.
Does anyone have any ideas?
If you want to do it in Java then you'll need to learn Java before you can do it.
Eventually you'll do some stuff with paintComponent and MouseListeners but that's off in the future. For now [_start here_|http://java.sun.com/docs/books/tutorial/java/index.html] -
What's the Best LCD (20"/ larger) and best Graphic Card choice /G4 733DA?
I know very little about the great choices for flat panel displays and also graphics cards on a Mac G4 733DA
So any recommendations would be sincerely appreciated.
What's a good LCD (20"/ larger) and the best Graphic Card choice for a G4 733DA? A friend recommended an ATI 9800 Pro (Mac Edition) Is this a good choice?
My current G4 733 Digital Audio has a standard VGA port as well as an ADC port.
Will I need to upgrade the existing graphics card if I’m looking to view wide screen?
Here's what i currently have on my g4 for a graphics card:
NVIDIA GeForce2 MX:
Chipset Model: GeForce2 MX
Type: Display
Bus: AGP
Slot: SLOT-1
VRAM (Total): 32 MB
Vendor: nVIDIA (0x10de)
Device ID: 0x0110
Revision ID: 0x00a1
ROM Revision: 1045F
Displays:
VGA Display:
Resolution: 1024 x 768 @ 75 Hz
Depth: 32-bit Color
Core Image: Not Supported
Main Display: Yes
Mirror: Off
Online: Yes
Quartz Extreme: Supported
Lastly, is 1080p even possible on this mac system provided I perform the above upgrades to say an ATI 9800 Pro (Mac edition)? Or will this also require a major dual processor CPU upgrade?
SDMacuserThe ATI Radeon 9800 Pro is the best card you can put in a G4 Power Mac. As for supporting HD, I believe its a mix between CPU and GPU, based on your system. The Radeon 9800 should support HD, and any HD supporting LCD. Price, wise, for a HD ready screen I'd say the a high quality Dell LCD would be good (it uses the same panel as the Apple 20" LCD) but costs less. You should not have to upgrade your CPU, although it would not hurt to look into it.
-
Find best collection class for the scenarios given
Hi Everyone,
Can u help me in answering this questions:
Indicate the most efficient / appropriate standard Java (JDK 1.4 or lower) collections class for each requirement. Do not use any classes that are not in the standard JDK (e.g. Apache commons-collections classes).
2.1. An un-ordered, unique collection
2.2. An insertion-ordered, non-unique collection
2.3. A sorted, unique collection
2.4. An insertion-ordered, unique collection
2.5. Random access to elements within a list
2.6. Insertion into random points within a list
2.7. A last-in-first-out queue
Please let me know what u think ?
IF possible please tell me the reason why u selected one over the other
Thanks in advance....2.1. An un-ordered, unique collection
HashSet thereadOkay, why?
2.2. An insertion-ordered, non-unique collection
LinkedList thereadOkay, why?
2.3. A sorted, unique collection
TreeSet theread
TreeMap kv pair thereadOkay, but is collection with a small "c" or Collection with a captial "C"? Maps don't implement the Collection interface. In a general sense, you could consider them collections, but in Java land, usually that implies single-valued groupings--i.e., those that implement Collection.
>
2.4. An insertion-ordered, unique collection
LinkedHashSet theread
LinkedHashMap thereadSame comments as above.
2.5. Random access to elements within a list
LinkedList (In fact any class that implements List
Interface)No. Hint: Do you know what "random access" means, and why LinkedList is not a good choice?
2.6. Insertion into random points within a list
LinkedHashSet
LinkedHashMapNo. It doesn't say anything about uniqueness or k/v pairs.
2.7. A last-in-first-out queue
StackOkay.
2.8. List any of these classes which are not
thread-safe, if any. How
would you make these Collections thread-safe?
HashSet, LinkedList, TreeSet, TreeMap, LinkedHashSet,
LinkedHashMapI'm not going to match 'em all up one by one, but it seems about right.
This is typically accomplished by synchronizing on
some object that naturally encapsulates the collection
class. If no such object exists, the map should be
"wrapped" using the Collections.synchronizedMap
method. This is best done at creation time, to prevent
accidental unsynchronized access to the map:
Map m = Collections.synchronizedMap(new TreeMap(...));Sounds about right. Also sounds like it was copied and pasted. If so, do you understand it? -
What is the best Mac choice for creating pro-level art/graphics/animation?
I'm an artist who does a lot of work with Adobe Creative Suite CS5, as well as some video editing and lots of animation. I've been using a 2007 model 15-inch Macbook Pro for the last 4 years, and it seems like it's time to upgrade...it runs burning hot all the time, and the battery dies pretty quick when the cord falls out. It seems like the whole thing is running a little slow, which is probably because I have a TON of graphics/animation/video software on there, but I need each and every program.
My question is, what is the best new Mac to purchase to replace this one? I want to make sure it lasts as long as possible, and will be able to handle the programs I use now. My first thought is to get another Macbook Pro, because of the portability, and just add on all the higher RAM, etc to customize it. But my husband suggested looking into the Mac Mini, because it's a lot cheaper, and we're a little strapped for cash at the moment. Would that serve the purpose? Or is a Macbook Pro really the best choice for what I need it to do?
I'd love to hear suggestions from other artists or graphics people. What do you recommend?For a "cash strapped" person, unless you already
have a monitor, one of the new iMacs may be
a better choice. If you do have a monitor, I would
suggest the dual core i7 equipt MacMini. Since you state
you are using CS5 stuff, most Adobe apps,
Photoshop for example, do not make effective
use of multiple cores. Also, using any of the
Adobe products, regardless of which computer
you decide on, get as much RAM as you can afford. -
Best choice for a date column in forms
Hello,
I want to know what is the best choice for a date field that the user have to enter manually. I read on a other post that a calender control is not directly implemented in forms 9i. So what is the best choice to be "user friendly" with a date field in a form?
thanks in advance.Hi
Don't know if this would be much use to you, but I wrote this function 'Check_Date' a while back to check whether the user had typed something which could be interpreted as a date. You'd make your date field into a Text Item, and include a call to this function (which could be in your form, or in a library) in the WHEN-VALIDATE-ITEM trigger on the item, ie:
IF NOT check_date(:ITEMS.date_item1, NULL, NULL) THEN
RAISE FORM_TRIGGER_FAILURE;
END IF;This would mean that the user could type 'T' or '*' for today, '+1' for tomorrow, '-7' for one week ago, or the date in a variety of formats. When they leave the field, the function tries to resolve what they've typed into a date, and sets the field to a date in the correct format.
('Display_Alert' is just a function to display a named alert with a message.) It can also be used to check that the date entered doesn't fall outside upper and lower bounds. Code follows:
FUNCTION Check_Date (text_in IN OUT VARCHAR2,
lower_bound_in IN DATE,
upper_bound_in IN DATE)
RETURN BOOLEAN IS
first_letter VARCHAR2(1) := SUBSTR(text_in, 1, 1);
date_ok BOOLEAN;
this_date DATE;
date_diff NUMBER(8);
output_format VARCHAR2(12) := Get_Application_Property(BUILTIN_DATE_FORMAT);
TYPE date_format_table_type IS TABLE OF VARCHAR2(12)
INDEX BY BINARY_INTEGER;
date_format_table date_format_table_type;
BEGIN
--Set up table of date formats in order they'll be tested for
date_format_table(1) := 'DD-MON-RRRR';
date_format_table(2) := 'DD-MM-RRRR';
date_format_table(3) := 'DD-MM';
date_format_table(4) := 'DD-MON';
date_format_table(5) := 'YYYY-MM-DD';
date_format_table(6) := 'YYYY-MON-DD';
--Use of T, or * for today's date...
IF UPPER(text_in) IN ('T', '*') THEN
this_date := SYSDATE;
date_ok := TRUE;
--Look for use of +x/-x for number of days different from today
ELSIF first_letter IN ('+', '-') THEN
BEGIN
date_diff := TO_NUMBER(SUBSTR(text_in, 2));
IF first_letter = '+' THEN
this_date := SYSDATE + date_diff;
ELSE
this_date := SYSDATE - date_diff;
END IF;
date_ok := TRUE;
EXCEPTION
WHEN VALUE_ERROR THEN
--User has entered something like '+X', so not valid
date_ok := FALSE;
END;
ELSE
--Go through all the possible formats for date entry,
--if any give a valid date, then return that.
FOR ix IN date_format_table.FIRST..date_format_table.LAST LOOP
EXIT WHEN date_ok;
BEGIN
--Try creating a date using the format masks in the local
--table. If no good, this will throw an INVALID_DATE exception
this_date := TO_DATE(text_in, date_format_table(ix));
date_ok := TRUE;
EXCEPTION
WHEN OTHERS THEN
date_ok := FALSE;
END;
END LOOP;
END IF;
IF date_ok THEN
--Check for violation of lower/upper bounds on date
IF (lower_bound_in IS NOT NULL AND this_date < lower_bound_in) THEN
Display_Alert('info_alert', 'Date cannot be before '||TO_CHAR(lower_bound_in, output_format));
date_ok := FALSE;
ELSIF (upper_bound_in IS NOT NULL AND this_date > upper_bound_in) THEN
Display_Alert('info_alert', 'Date cannot be after '||TO_CHAR(upper_bound_in, output_format));
date_ok := FALSE;
ELSE
text_in := TO_CHAR(this_date, output_format);
END IF;
ELSE
Display_Alert('INFO_ALERT', text_in||' is not a valid date !!');
END IF;
RETURN date_ok;
END;Hope this is useful.
regards
Andrew
UK -
Which of these 2 laptops would be my best choice for editing video?
I am going to get a new laptop mainly to use for LR and PS but I also want to be able to edit video. Which of these 2 laptops is my best option...
ASUS ROG G751JT-CH71
Intel Core i7-4710HQ 2.5 GHz
16 GB DDR3
1000 GB 7200 rpm Hard Drive
17.3-Inch Screen, Nvidia GTX970M 3GB GDDR5
Windows 8.1
Or
Acer Aspire V17 Nitro Black Edition VN7-791G-730V
Intel Core i7-4720HQ Processor (2.6 GHz)
16 GB DDR3 RAM
1 TB 5400 rpm Hard Drive, 256 GB Solid-State Drive
17.3-Inch Screen, NVIDIA GeForce GTX 860M
Windows 8.1, 4-hour battery life
Additionally, if you feel there is a better choice for $1500 or less, I would love to hear that advice as well. I would really appreciate your help in making this decision. Thanks!Of the 2 the Asus everyday. You won't notice the difference in the CPU's but you will more so with the GPU's as the 970 is a decent step up from the 860m. Add in extra SSD/HDD and RAM (I believe it goes up to 32GB but check), and see if they have allocated the 16GB as 2x8GB sticks or 4x4GB sticks.
Other option I would suggest looking at a custom PC builder such as Cyberpower, Xotic or other (no affiliations, heck I don't even live in the same country). You will be able to get a much more tailored system with a better upgrade path within your budget. You will get better CPU, better GPU, RAM options up to 32GB and more flexible drive and msata combinations and most importantly some flexibility with the way the system is configured. Some are re-brands of popular gaming laptops, some are from the more custom line of chassis and some are just tweaked versions of your off the shelf names. Plus you don't have to crack the thing open to replace drives etc. that you are paying for but won't use due to slow speeds and the warranty implications that can come from doing this
Not saying buy this as you need to shop around and find what suits you best but as an example this is from Xotic.
Sager NP8670 (Clevo P670SA)
- SAGER Spring Savings
- FREE!!! – U.S. UPS GROUND SHIPPING (Use Coupon Code "FREESHIP" in Checkout) [U.S. Lower 48 ONLY / Restrictions Apply]
- 17.3" FHD 16:9 "Matte Type" Anti-Glare Ultra Bright Screen (1920x1080)
- Standard No Dead Pixel Policy
- 4th Generation Intel® Haswell Core™ i7-4720HQ (2.6GHz - 3.6GHz, 6MB Intel® Smart Cache)
- - Stock OEM Thermal Compound
- NVIDIA® GeForce™ GTX 965M (2.0GB) GDDR5 PCI-Express DX12 (Maxwell) w/ Optimus™ Technology
- 16GB DDR3 1600MHz [2x8GB] Dual Channel Memory (SKU - RAM04S)
- Sager Branding
- Standard Laptop Finish
- No M.2 mSATA Drive
- No M.2 mSATA Drive
- 1TB 7200RPM [SATA II - 3GB/s] (SKU - HDDYY1)
- 120GB Crucial BX100 Series SSD [SSD2 - SATA III] (SKU - SSD092)
- Bluetooth Included *With select wireless cards only* (See “Wireless Network” Section Below)
- Sager - Intel® Dual Band AC 7265 [M.2 Chip] 802.11 A/AC/B/G/N 2.4/5.0GHz + Bluetooth™ 4.0 (SKU - WIFIX1)
- Internal 6-in-1 Card Reader
- Built in 2.0 Megapixel Camera
- Sound Blaster Compatible 3D Audio - Included
- Smart Li-ion Battery (4-Cell)
- Integrated Fingerprint Reader
- ~Windows 8.1 - 64-Bit (64-Bit CD Included) + MS Office 2013 Trial
- LIFETIME Ltd Labor* 1 Year Parts Warranty Lifetime 24/7 DOMESTIC Technical Support (Labor through XPC)
Includes FREE Shipping Both Ways for Parts Warranty Repairs (SKU - WTY099)
- * 24/7 LIFETIME U.S. based technical support
* Extreme QA testing by dedicated technicians
* 24-72 Hour stress testing and benchmarking to ensure top performance and stability
- Standard Production Time
$1,429.00
Sub-Total: $1,429.00
Drops to $1386.13 with 3% cash pricing. -
Best choice for a proxy server on NT?
Hi, I'm wondering what the best choice for a proxy server is on NT?
Currently I'm running a 2 WL server cluster, but this will grow rapidly. If
all of the pages that I will be handling will be .jsp (with the exception of
1 or 2 servlets), which is the best configuration (performance wise) to go
with?
Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
guess was that IIS would perform the best on an NT machine and that it would
not be as large as a memory hog as Weblogic would be to simply run as a
proxy. Is there a significant amount of latency produced by the ISAPI
bridge?
Any suggestions?
Thanks,
Chris
Chris,
Please do not cross post across the newsgroups. We would very much
appreciate it.
There is a response to this message posted on the performance newsgroup if
you're interested.
Thank you so much!
Michael Girdley
BEA Product Manager
Chris <[email protected]> wrote in message
news:851ks4$auk$[email protected]..
> Hi, I'm wondering what the best choice for a proxy server is on NT?
>
> Currently I'm running a 2 WL server cluster, but this will grow rapidly.
If
> all of the pages that I will be handling will be .jsp (with the exception
of
> 1 or 2 servlets), which is the best configuration (performance wise) to go
> with?
>
> Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
> guess was that IIS would perform the best on an NT machine and that it
would
> not be as large as a memory hog as Weblogic would be to simply run as a
> proxy. Is there a significant amount of latency produced by the ISAPI
> bridge?
>
> Any suggestions?
>
> Thanks,
> Chris
>
>
-
Best "workflow" for bouncing instruments to audioclips
What would be the best "workflow" to bounce an audio instrument sequence/region to an audio clip, but retaining the same inserts, sends, automation for the audio as I have on the audio instrument track?
I'm trying to find a good alternative to freeze-function. Freeze is a bit too limiting for me, as you cannot move clips after freezing. I sort of just want to convert the audio instrument midi regions to audio and continue arranging the song, doing automation etc. I mostly work with loop based music.
So.. now when bouncing an audio instrument region, I need to
- start from arrange
- turn off all inserts and sends for the instrument
- do a bounce
- open audio window
- drag audio clip to a new track
- goto environment (or audio config?)
- copy all inserts to new track
- build same sends manually
- goto arrange
- copy all the automation from other track
Now that's a lot of work. Is there any better way to do this?bit hard to follow there justin.
i've been wanting a good way to do this as well. because, eg, i was doing a fiolm that used a lot of guitar and a lot effects on the guitar. i had an audio inst for the mockups, and then i wanted to replace the mockup guitar for the audio after it was recorded. there is no really convenient way of doing this i have found. even saving the channel strip setting didn't not work from audio inst to audio track. obviously i got there, but it took a lot of hair-tearing and brain work.
I had a real crack at this rami and couldn't find a nifty way of doing it - which is unusual for logic. maybe someone knows something we don't? -
Which is the best user-friendly IDE for swing program development
Which is the best user-friendly IDE for swing program development
I have seen Sun's Forte and IBM's Visual Age for Java.
But Borland's JBulider 7 Personal Edition is far more superior than any of these.Borland's JBuilder is the Best.
Ranga. -
Best choice for a bluetooth car kit for the 4S?
I want to add a car kit to my 2004 MINI I have the Aux in jack for the audio HK ans XM radio system that came with the car but the 2004 Nokia bluetooth kit that was installed when the car was new only worked with a 2004 Nokia feature phone and after I replaced that phone with a motorola phone in06 I have had to use a Jabla ear piece for hands free in the car... and with the new 4S I would like to fit a proper working bluetooth car kit I understand there is something new about how bluetooth is implimented in the 4S that is causing some problems with car kits.
has a concesis as to what should be bought yet? if not if the smart thing to do to wait a few months?Chris,
Please do not cross post across the newsgroups. We would very much
appreciate it.
There is a response to this message posted on the performance newsgroup if
you're interested.
Thank you so much!
Michael Girdley
BEA Product Manager
Chris <[email protected]> wrote in message
news:851ks4$auk$[email protected]..
> Hi, I'm wondering what the best choice for a proxy server is on NT?
>
> Currently I'm running a 2 WL server cluster, but this will grow rapidly.
If
> all of the pages that I will be handling will be .jsp (with the exception
of
> 1 or 2 servlets), which is the best configuration (performance wise) to go
> with?
>
> Should I use a Weblogic Servlet, NSAPI, or ISAPI to do the proxiing. My
> guess was that IIS would perform the best on an NT machine and that it
would
> not be as large as a memory hog as Weblogic would be to simply run as a
> proxy. Is there a significant amount of latency produced by the ISAPI
> bridge?
>
> Any suggestions?
>
> Thanks,
> Chris
>
>
-
Best Azure Data Center choice for serving content in Canada?
Hello,
Curious - What is the best Data Center choice for a CDN if your primary audience is in Canada? (or does it even matter?)
I've asked Azure support if a data center will be opening up in Canada, and it appears that there are no plans for such. So, if we are serving [primarily images] via Azure Storage (CDN) -- what is the best choice for a data center; as all traffic will
be heading North (to Canada)?
Also -- does anyone know of a SIMPLE price comparison chart that shows the cost of all the major CDNs, i.e.: Azure, S3, Google, etc. with regard to storage costs and bandwidth costs? (Might be an interesting project to build)
Thanks in advance.Hi,
As of now, there is no plan to open a Data center in Canada. However, depending on the location you are in Canada, you may choose East US2/EastUS or West US or North Central US DataCenter which ever is near by to you.
You may check the price of your services hosted in Azure through following link:
http://azure.microsoft.com/en-us/pricing/calculator/?scenario=full
Regards,
Manu
Maybe you are looking for
-
I have one Apple ID for iCloud that is used on multiple devices. Each user has their own Apple ID for Store purchases. Can I use my Apple ID that is NOT my iCloud ID as a way to get my iMessages/FaceTime on multiple devices?
-
MY ITOUCH IS NO LONGER SYNCING WITH MY ITUNES
MY ITOUCH IS NO LONGER SYNCING WITH MY ITUNES
-
IMac dings but there is no picture
MY iMac dings not there is no picture. What did I do now
-
Why are the brushes grayed out
I am having a hard time using brushes in Aperture 3. When I imported photos from iPhoto....and then go to edit these using brushes....all the options are grayed out except for the retouch option. Help!
-
Hi, Can anyone tell me how I can remove selected MIC in CWBQM. I am still quite a dummy on this t-code. Here are the steps I made. 1. Enter the work area. 2. Put in the task list number and then the MIC I want to delete on that task list Then I'm st