How to model coordinates
Pretend I have a little RTS game using units, structures and terrain.
Each has a coordinate.
It definitely is not is-a
It sort of is has-a
Pretend I have a little RTS game using units, structures and terrain.Done.
Each has a coordinate.Right
It definitely is not is-a??
It sort of is has-a??
Is the game 2D, 3D ?
If it is a 2D game you could use a java.awt.Point
For 3D you could extends this or use this as an example for a 3D point.
Similar Messages
-
How to model multiple parent hierarchy in obiee
hi,
I have product hierarchy with multiple parents for a single level. and i want to display all the levels of hierarchy at a same time.
Below mentioned is wht data i am getting from product table in OLTP
current product diamension
root1--level 1
child product1--level 2
child product2--level 3
child product3 ----level 4
and
root2----level 1
child product4----level 2
child product2----level 3
child product3 ----level 4
If u see we have child product2 belongs to two diff hierarchies.
My report req is i want to show all the levels of product in single row.Some thing like
Mb no. level 1 level 2 level 3 level 4
123 root1 CP1 Cp2 CP3
123 root2 CP4 CP2 CP3
How to model this scanario in OBIEE?H,
Refer this
http://oraclebizint.wordpress.com/2007/11/30/oracle-bi-ee-101332-one-dimension-multiple-hierarchies/
http://www.rittmanmead.com/2010/11/oracle-bi-ee-11g-parent-child-hierarchies-multiple-modeling-methods/
Thanks
Deva -
How to get coordinates from Google Map
I wonder how to get coordinates from Google Map to JavaFX application when click has occured. Here is an example of code:
public class JavaFXApplication extends Application {
public void showCoordinates(String coords)
System.out.println("Coordinates: " + coords);
@Override public void start(Stage stage)
final WebView webView = new WebView();
final WebEngine webEngine = webView.getEngine();
webEngine.load(getClass().getResource("googlemap.html").toString());
webEngine.getLoadWorker().stateProperty().addListener(
new ChangeListener<State>() {
@Override
public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
if (newState == State.SUCCEEDED) {
JSObject window = (JSObject) webEngine.executeScript("window");
window.setMember("java", new JavaFXApplication());
BorderPane root = new BorderPane();
root.setCenter(webView);
stage.setTitle("Google maps");
Scene scene = new Scene(root,1000,700, Color.web("#666970"));
stage.setScene(scene);
stage.show();
public static void main(String[] args){
Application.launch(args);
// googlemap.html file
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100%; background-color: #666970; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(40.75089, -73.93804);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
panControl: true,
navigationControl: true,
streetViewControl: false,
backgroundColor: "#666970"
var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
document.map = map;
google.maps.event.addListener(map, 'click', function(event) {
//java.showCoordinates(event.latLng); ???
map.setCenter(location);
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>Edited by: krbltik on 03.10.2012 22:59Hi, welcome!
You may also have a look at GPS Info Qt, available for free at Ovi Store: http://store.ovi.com/content/165671
GPS Info Qt is a nice Qt app. I have it on my C6-01 and I like it.
Regards. -
How describe model data and get select in DB throw topLink.
Hello,
I have table from code
create table t_tree
id int primary key,
parent_id int,
value varchar2(255)
Alter table t_tree
add constraint constr_id_parent foreign key (parent_id) references t_tree (id)
I must get query
select level as lv,lpad('-@-', (level-1)*2)||value as MMM, t.* from t_tree t
connect by prior id=parent_id
start with T.PARENT_ID is null
How describe model data and get select in DB throw topLink.
Dema.So you'll probably have to write a function which uses dynamic SQL to retrieve the desired message text, like this untested one:
CREATE OR REPLACE FUNCTION get_msg(p_db IN VARCHAR2,
p_id IN NUMBER)
RETURN VARCHAR2
IS
msg_txt VARCHAR2(4000);
BEGIN
-- make sure p_db is a valid database link ...
EXECUTE IMMEDIATE 'SELECT d_msg FROM msg@' || p_db || ' WHERE t_id = :id' INTO msg_txt USING p_id;
RETURN msg_txt;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END get_msg;
/The you can update likeUPDATE mex
SET t_msg = get_msg(db_id, t_id);Hth, Urs -
How to model a conversion table for unit of measures?
Hi
I am looking for some input on how to model a many-to-many relationship.
The situation:
A fact table with columns:
Product
Unit of Measure
Date
Value
1 product is stored with 1 and only 1 unit of measure - e.g. Product = Oil, unit of measure = m3
The fact contains several products, each having its own unit of measure.
A dimension 'Unit of measures' with columns
Unit Of Measure
Unit Of Measure Name
Measure System
While reporting on the facts it should be possible to chose the unit of measure I want to see my facts in. E.g. I want to be able to show Oil-production in m3 or barrels or liters, etc.
My challenge:
How to model this requirement?
Right now I tend to go for a bridge table between the fact and the dimension.
But I was wondering:
a) are there other ways to model it
b) are there pitfalls in using Bridge tables?
c) Can I re-use the bridge table in combination with other facts as the model grows?
c.2) do I need to create an alias on the bridge table to re-use it?
Thanks for your help
regards
AndyHi Kart,
ok let's say my model looks like this (columns below the tables names, sample in brackets) - again ignoring a date dimension:
Dim_Product --- 1:n --- Fact ----- n:1 ----- Dim_UOM
Id (1,2) Prod_id Id (1,2,3)
Name (Oil, Gas) UOM_id Name (m3, Barrel, Litre)
Value
So the products are coming from the Dim_product, Unit_of measures coming from Dim_UOM.
Fact values would look like this
Prod_id UOM_id Value
1 1 10
1 2 84
1 3 10000
etc
If I need to report in a new measure, I would be forced to add a new record to the fact table
Prod_id UOM_id Value
1 1 10
1 2 84
1 3 10000
1 4 150
with 4 being the new measure id.
What I am looking for is a way to be more flexible when it comes to converting values to different measures.
Thanks
Regards
Andy -
Having variations of same business process, How to model?
Customer has several variations of the same business process. How to model them in Solution manager's project implementation tools? I actually created this same question in 'Business process expert' forum, so please read the whole story there and earn your points there.
Having variations of same business process, How to model?
Best regards,
KimmoHi Kimmo,
I wouldn't use process steps to refine processes. This is incompatible to SAP implementation content coming from BPR (Business Process Repository). But a good idea would be to copy the main business process e.g. "Sales order processing" into two new processes on the same level, e.g. "Sales order processing by manual input" (variation1) or "Sales order processing by incoming interface" (variation2). Then you can use the Compare Button on the variations to see if any changes have been on the main business process and copy them to the variations. This minimizes the effort to keep track of changes after creating the variations. When you run transaction SA_PROJECT_UPGRADE on that project these changes even get flagged. Mostly this function is used to upgrade against BPR or a template project but it works also for copies inside a project e.g. to model variations.
Regards
Andreas -
How to add coordinate system SVY21(SRID: 3414) to Oracle Spatial 11g/12c
Can any one please help me for "How to add coordinate system SVY21(SRID: 3414, for Singapore) to Oracle Spatial 11g/12c'?
Why don't you start with the documentation: Coordinate Systems (Spatial Reference Systems)
Especially paragraph 6.9 (6.9 Creating a User-Defined Coordinate Reference System ) should be helpful for you.
HTH,
Stefan -
Hello BW Experts,
The report should show the customer 30day and 60 day balances according to the date entered. How to model 30 day balance for a customer. All we have is the current balance in the transaction record.
Possible solutions
1) can we calculate the fields and add them in the ods / cube
2) should be only dynamically calculated in the query, what is the best method to implement this.
3) Have a restrict key figure restrict w.r.t to 0calday and by using the user entered date in variables ( please explain this option in detail, how to implement this)
Any suggestions appreciated
Thanks
BWerHello BWer,
You can dynamically calculate it in query.
What cube is this?
If FIAR look at this report http://help.sap.com/saphelp_bw32/helpdata/en/ac/b2ae397f768c3ce10000000a11402f/content.htm.
Do you need something similar to this?
Otherwise give us some more details like what other characteris you have? Is balance calculated based on Posting date? or do you have any net due date for the document ?Is there any clearing status/Clearing date?
Vijay. -
How to enter coordinates when drawing Pen Tool?
Hello and immediately apologize for my bad English.
I have a question - how to enter coordinates for a point that has been applied to a drawing? For example:
1 point
X = Y = 37 cm 22 cm
2.point
X = Y = 38 cm 35 cm
ETCCan you give any details on this?
-
How to model a text field 2000 chars long.Thanks in advance
Hi All,
There is a field for Account object called comments.This field is of Varchar nature and length is 2000 chars.The field is in CRM system.I need to map it to BW.How to model this field as attribute of Account Infobject.Is it as atext?If so can i declare it as a char.will it hold 2000 chars
Thanks.If you want get this 2000 chars into BW , We need create 34 Attribures and split the 2000 chars into 60...60 in tranfer rule.
By
CCC -
How to Modelling a 3D human face??
Hi there, everyone
I am new to Java3D , I would like to build a 3D face of a human but i have not idea how to start.looking for any indication of how to model a human face by just using pure java, many thanks.java 3d is fairly easy to learn - check out the documentation on this site which includes a good tutorial. as for modelling a human face by far the easiest way to do this will be in an actaul 3d package like 3d studio max. alternatively you may be able to find a mesh somewhere on the web for free. you can then import this data into java 3d for representation in a java program. just using java3d will take you forever unless the face is very very simple.
java3d is really for displaying 3d data rather than modelling new complex real world objects. i used it to build 3d flowers but there are algorithms for making such structures. -
How to get coordinates of FileSystemTree selected item ?
Hi can some one clue me in how to get the coordinates of the
selected itwn in a FileSystemsTree ?
thx
-gHi Amy,
I looked at the code, this is the width calculation.
There are four (4) parts to each of the tree node display:
1) the indent, from _listData.indent Only value id _data is
not null
2) the disclosureIcon.width
3) icon.measuredWidth
4) label measured or explicate width
The positions are calculated by:
1a) disclosureIcon.x = the indent
1b) disclosureIcon.setActualSize = disclosureIcon.width,
disclosureIcon.height
2a) icon.x = the indent + disclosureIcon.width
2b) icon.setActualSize = icon.width, icon.height
3a) lable.x = the indent + disclosureIcon.width + icon.width
3b) lable.setActualSize = lable.width, lable.height
The label width:
label.width: the size of the visible portion of the label in
the parent. It may be clipped/truncated.
label.textWidth: the total size of the text in the label
Maybe I can get the code finished today.
BTW, as I'm moving through this processes of learning flex,
the one thing I've noticed is the lack of a concise MVC model or at
least a breakout of the more complex UI components. I'd assume for
such a strategic product, there would be more investment by Adobe
in these technical areas. But, I guess its easier putting people on
a bus and send them to city to city.
-g -
In Flex2, How to get coordinates in a view port?
I know one can use something like
fooUIControl.localToGlobal(new Point(x,y))
to get the coordinates corresponding to the origin at the top
left of the main flex app 'document'.
In case that the main flex app scrolls, how can I get the
coordinates corresponding to the origin at the top left of the
visible screen (or the 'viewport')? Or in other words, how can I
find out how many pixels are scrolled in X and Y? Thanks.The horizontalScrollPosition and verticalScrollPosition
properties of a scrolling container tell you how many pixels it has
scrolled. -
How to get coordinates of components. PLEASE HELP ME URGENT!
Hi, I am trying to get the coordinates of my components that are tabbed pane buttons, buttons, text fields etc so I can place an image of a pointer under it that points to it and then under the image of the pointer I would put a label describing the button for example "press the tab to start". Then when I press tab1 the image of pointer image points to the next component and has a label under pointer.
Now I have tried using componenet.getX() and getY() and then set the values of the the image panel to use then the label panel so they be placed under the component, these panels are not using layout manager but absolute positioning. If the window is resized then the labels and image of pointer should also adjust. I have tried putting the label and arrow into a glasspane and now layerdpane as some people here suggested which when I do then add it to contentpane the main panel with the components is not there but the layerd pane is.
I am having huge difficulties with this and if someone can Please just tell me or even better give me an example code how to find out the coordinates of components so I can place my image of pointers and labels underneath them I will be very grateful of you. I am on a verge of giving up accomplish what I am doing and I am new to the swing framework. My progress to solve this has been very slow and frustrating. I just hope someone here can help.I tried the both of codes given. But the code given by both the person i have not understand. And what they there code is doing. This is the code form my side if this example help u.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
* Author Waheed-Ul-Haq ( BS(CS)-8 )
public class Samulation2
JPanel pane;
JLabel label1;
JTextField entProcesfld;
JButton buttCreat;
JButton buttReslt;
JLabel usrProcesID[];
JTextField usrArivTam[];
int processes;
public JComponent createComponents()
pane = new JPanel();
pane.setLayout (null);
label1 = new JLabel(); //Label for to tell user to enter no of Processes.
label1.setText("Enter the no. of Processes");
pane.add(label1);
label1.setBounds(20, 25, 150, label1.getPreferredSize().height);
entProcesfld = new JTextField(); //TextField to enter no of processes.
entProcesfld.setToolTipText("Enter the no of Processes.");
pane.add(entProcesfld);
entProcesfld.setBounds(180, 25, 100, entProcesfld.getPreferredSize().height);
buttCreat = new JButton(); //Button to create the TextFields.
buttCreat.setText("Create TextFields");
pane.add(buttCreat); //Adding cutton to Jpane.
buttCreat.setBounds(new Rectangle(new Point(30, 60), buttCreat.getPreferredSize()));
buttCreat.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
buttCreatActionPerformed(e);
} } ); //ActionListenr to Create the TextFields.
pane.setPreferredSize(new Dimension(600,600));
return pane;
} //-------END of Component createComponents()--------//
private void buttCreatActionPerformed(ActionEvent e) //Action to Create the TextFields.
processes = Integer.parseInt (entProcesfld.getText ());
JLabel Labproces = new JLabel(); //Label of Processes.
Labproces.setText("Processes");
pane.add(Labproces);
Labproces.setBounds(new Rectangle(new Point(15, 105), Labproces.getPreferredSize()));
JLabel labArivTam = new JLabel(); //Label of Arival time.
labArivTam.setText("Arrial Time");
pane.add(labArivTam);
labArivTam.setBounds(new Rectangle(new Point(90, 105), labArivTam.getPreferredSize()));
//----Creating Dynamic JLabels------//
usrProcesID = new JLabel[processes]; /* Makes an array */
int yXis = 125; //Variable for Y-axix of JLabel.
for(int i=0; i<processes; i++) /* i takes each value from 0 to processes-1 */
usrProcesID[i] = new JLabel("P" + i); /* Makes a JLabel at an array place */
pane.add(usrProcesID); /* Adds a JLabel (rather than an array) */
usrProcesID[i].setBounds(new Rectangle(new Point(28, yXis), usrProcesID[i].getPreferredSize()));
yXis = yXis + 25; /* Increses the Y-axis to show JLabels. */
} //EndFor
//-------End Dynamic JLabels---------//
//-----Creating Dynamic Arival Time TextFields-----//
usrArivTam = new JTextField[processes]; /* Makes an array */
yXis = 125; //Variable for Y-axix of JTextField.
for(int i=0; i<processes; i++) /* i takes each value from 0 to processes-1 */
usrArivTam[i] = new JTextField(); /* Makes a JTextField at an array place */
usrArivTam[i].setToolTipText("Enter Arival Time.");
pane.add(usrArivTam[i]); /* Adds a JTestField (rather than an array) */
usrArivTam[i].setBounds(100, yXis, 35, usrArivTam[i].getPreferredSize().height);
yXis = yXis + 25; /* Increses the Y-axis to show JTextFields. */
} //EndFor
//-----End Dynamic Arival Time TextFields.-----//
//----Calculating points for Label and textfields.
Point poi = new Point();
poi = usrArivTam[processes-1].getLocation (); //Getting the location of the last text field of ArivalTime.
//-----Label for Average Waiting time.--------\\
JLabel averWaitLB = new JLabel();
averWaitLB.setText("Average Waiting Time");
pane.add(averWaitLB);
averWaitLB.setBounds(new Rectangle(new Point(30, (int)poi.getY()+50), averWaitLB.getPreferredSize()));
//-----TextField for Average Waiting Time.--------\\
JTextField averWaitTF = new JTextField();
averWaitTF.setText ("Hello");
averWaitTF.setEditable(false);
pane.add (averWaitTF);
averWaitTF.setBounds(190, (int)poi.getY()+50, 35, averWaitTF.getPreferredSize().height);
} //------END of void buttResltActionPerformed(ActionEvent e)---------//
private static void createAndShowGUI()
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("Priority Scheduling (Non-Preemptive)....");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Samulation2 application = new Samulation2();
//Create and set up the content pane.
JComponent components = application.createComponents ();
components.setOpaque (true);
int vertSB = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
int horzSB = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
JScrollPane scrollPane = new JScrollPane(components, vertSB, horzSB);
scrollPane.setPreferredSize (new Dimension(720,455));
frame.getContentPane ().add (scrollPane,null);
//Display the window.
frame.pack();
frame.setVisible(true);
} //------END Of void createAndShowGUI()--------//
public static void main(String[] args)
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
} //---------End of main()----------------//
} //--------END of class Samulation2----------//
If any body help me implementing the ScrollBars in this code. I am unable to use Scroll Bars with this code while using NULL layout. If any body tell me how to get the Size and set for the pane. -
Hello experts,
Need help modelling the below data into Cubes:
Sales Extractor:
Has 30 fields including:
Sales Doc: Sales Order Item: Config no.: Plant: Material: Customer Group: etc
85252 10 1 4525 0001 Engine 10
Options Extractor:
Sales Doc: Sales Order: Item Config No.: Characteristic Name: Char Value:
85252 10 14525 Alternator ALT
85252 10 14525 Alternator ALT02
85252 10 14525 Valve 3
(there maybe up to 100 characteristics for each Sales Doc)
I have each extractor going into an ODS.
Now I am not sure what to do next?
For example I would want to run a report to see what Characteristics where sold to which customer group, so I need to bring both the ODS's together and then combine with a Cube (for Territory management from CRM).
Do you have any ideas how I could design this
Any help is much appreciated
Many Thanks
HelenHi there,
Thanks for your responses but I am still trying to get my head around how I would bring both extractors together
These are the extractors:
Sales Extractor
Has 30 fields including:
Sales Doc: Sales Order Item: Config no.: Plant: Material: Customer Group: etc
85252 10 1 4525 0001 Engine 10
Options Extractor:
Sales Doc: Sales Order: Item Config No.: Characteristic Name: Char Value:
85252 10 14525 Alternator ALT
85252 10 14525 Alternator ALT02
85252 10 14525 Valve 3
Want to bring both together so that I can see the sales details per option
eg How many ALT's are sold in Plant 0001?
At the moment both are coming into ODS? do I build another ODS? use Infoset?etc
Many Thanks for looking at this, really appreciate any advise
Helen
Maybe you are looking for
-
Dear All, We have a background job, which will execute a z program. The out put of Z program will be sent as a mail to the recipient listed in "Spool list recipient" (SM36). We did unicode conversion and upgrade to ecc 6.0. Even now background job se
-
HP Slate 7 Voice Tab overheat after kitkat update
Hi, I was using my Slate 7 voide tab for last around 8 months without any major issue. Minor issues like touch becomes very sluggish after switching on 3G was normal. Yesterday kitkat update got installed on my tab and than nightmare starts. First "c
-
Error text appearing in the body of all emails sent
Hello this is copied from a sent message this is appearing on all sent emails how do we get rid of this? -------- Original Message -------- From: - Tue Jul 29 15:31:07 2014 X-Account-Key: account7 X-UIDL: UID63418-1286200938 X-Mozilla-Status: 0001 X-
-
BPM : Procees the file based on the response of Webservice
Hi I have a scenario where two files are the source..and the target is Webservice Based upon the response of the first file ....i want to process the sencond file if not i want to raise an exception... whar are the steps i have to use in BPM.. SV
-
I have downloaded itunes direct to my pc but despite syncing with my ipod they are not downloading, however itunes downloaded direct to ipod are syncing to pc. Can anyone help please?