Saturday, September 25, 2010

Flash 3d Effects wonderful examples of (3)


Section 3 rotating triangular pyramid

The net effect of the examples shown in Figure 1:



Figure 1 The net effect of rotating triangular pyramid

1. First start Flash, create a video, set video scene size 253px * 205px (unit pixels), video background color is white.

2. In order to facilitate the production of the following, here and select View / Grid / Show Grid menu command, open the video capture function of the grid.

3. Select the line tool in the toolbox, which draws on the stage the outline of the three pyramid, shown in Figure 2:



Figure 2 Draw the outline of the three pyramid

4. Open the Color mixer panel, fill style in the drop-down list, select the linear gradient fill type, and then were set the gradient from light yellow (color code for RGB 251,217,162) to deep yellow (RGB color code for the 224,126,31) in gradient, shown in Figure 3;



Figure 3 Set fill color

Is set up, the front of pyramid in three mouse clicks, fill effect shown in Figure 4:



Figure 4, filled the front of the three pyramid

5. In accordance with the mixing device the same way then the fill color set to dark yellow to dark yellow linear gradient color, RGB value of one deep yellow (244,156,11), dark yellow RGB value (116 , 66,16), shown in Figure 5;



Figure 5 Set fill color

After setting, the three pyramid side click of the mouse, the final fill effect shown in Figure 6:



Figure 6, the side filled with three pyramid




[Next]



6. Select the arrow tool, double-click the triangular pyramid of the contour lines, contour lines will all selected, and then press the Delete key to delete the three pyramid's outline, and finally only three pyramid shown in Figure 7, blocks of color:



Figure 7, the contour lines to delete the three pyramid

7. In the first 20 layers Layer1 to insert a key frame, select the arrow tool and select the third pyramid to the right side, and select Edit / deformation / Flip Horizontal menu command, the three-level pyramid of the right of the flip side, then use the arrow tool to move it to the left of the three pyramid, shown in Figure 8:



Figure 8, the left side of vertebral produce triangular

8. And then set the first one to 20 for the shape gradient between the animation, but this time choose Control / Play menu command preview the effect, you can see the deformation of the three pyramid graphic is not quite right, so even set the control precisely the shape of the cue point. Select layer Layer1 the first one, and then select Edit / shape / shape prompted to add a menu command, add shape to the graphic cue point, then will appear in the work area of a circle of red color, and its one letter within a shown in Figure 9:



Figure 9 Add Shape Tips

Then press the keyboard shortcut Ctrl + H, will add a shape cue point b, respectively, using the same method to add shape cue points c, d, e, f, and then use the arrow tool to drag the shape of the cue point is shown in Figure 10 as shown in position;



Figure 10 to adjust the shape of the location of the cue point

9. Select layer Layer1 section 20, use the arrow tool to drag the graphic in the shape of cue points b, c, d, e, f as shown in Figure 11 Location:



Figure 11 re-positioning the location of the shape cue points

10. In order to produce a continuous rotation of the three pyramid effect, in the first 21 layers Layer1 insert a key frame, and remove the three pyramid to the left side, as shown in Figure 12:



Figure 12 Remove the three pyramid to the left side

11. Finally, layer layer1 time line can be extended to 22, the final timeline shown in Figure 13;



Figure 13, the main scene timeline






Recommended links:



Continuous PRODUCTION of the home page background music



Accelerator with the PP to see potatoes, no buffer Youku



DV To AVI



SAP Will Complete The 4.8 Billion Euros A Huge Deal



Review Hobby



Seagate layoffs affected 1,100 people in China: Li Xudong transferred to retire



How to avoid the trap of price competition?



BenQ projector and Joybee Brilliance



VOB to FLV



DAT To MPEG



Easy To Change Driving



News about Web Or Video Cams



Games And Entertainment Specialist



convert FOR



"Two" A Dell: Whose Heart Hurt



Tuesday, September 14, 2010

Eclipse + JBoss + EJB3 Entity Bean's connection strategy



In the previous article, the use of single-table strategy will be a table logically divided into multiple tables. However, this field may result in empty nest, that is, a logical table composed only of part of the field, while the physical form of the many field value will to null. To solve this problem, you can t_accounts table physically divided into multiple tables. In order to compare with the t_accounts table, create a new t_myaccounts table, the structure shown in Figure 1.






Figure 1 t_myaccounts table

From t_myaccounts structure can be seen in the table only contains the first three fields t_accounts table, then logically assigned to two different tables, so, we must first establish two physical forms: t_checkingaccount and t_savingsaccount. The two tables is structured as follows:






Figure 2 t_checkingaccount table






Figure 3 t_savingsaccount table

In t_checkingaccount and t_savingsaccount table has a account_id, the account_id value depends on the t_myaccounts table account_id.

Following the first to write and t_myaccounts corresponding entity Bean, the code is as follows:
package entity; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence. Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; @ Entity @ Table (name = "t_myaccounts") @ Inheritance (strategy = InheritanceType.JOINED) public class Account (protected String id; protected float balance; protected String type; @ Id @ GeneratedValue (strategy = GenerationType.IDENTITY) @ Column (name = "account_id") public String getId () (return id;) public void setId (String id) (this.id = id;) public float getBalance () (return balance;) public void setBalance (float balance) (this.balance = balance;) @ Column (name = "account_type") public String getType () (return type;) public void setType (String type ) (this.type = type;))
As can be seen from the above code, only use the @ Inheritance annotation on the entity Bean to.

Following the preparation of MyCheckingAccount and MySavingsAccount class code:

MyCheckingAccount class code:
package entity; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; @ Entity @ Table ( name = "t_checkingaccount") / / specify the Account class to share the primary key name @ PrimaryKeyJoinColumn (name = "account_id") public class MyCheckingAccount extends Account (private double overdraftLimit; public MyCheckingAccount () (/ / default to account_type field Fu value setType ("C");) @ Column (name = "overdraft_limit") public double getOverdraftLimit () (return overdraftLimit;) public void setOverdraftLimit (double overdraftLimit) (this.overdraftLimit = overdraftLimit;))
MySavingsAccount class code:
package entity; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; @ Entity @ Table ( name = "t_savingsaccount") @ PrimaryKeyJoinColumn (name = "account_id") public class MySavingsAccount extends Account (private double interestRate; public MySavingsAccount () (/ / default value assigned to account_type field setType ("S");) @Column(name="interest_rate") public double getInterestRate() { return interestRate; } public void setInterestRate(double interestRate) { this.interestRate = interestRate; } }
鍦ㄤ笂闈㈢殑浠g爜涓娇鐢ㄦ瀯閫犳柟娉曟潵鍒濆鍖栦簡t_myaccounts琛ㄧ殑account_type瀛楁鐨勫?銆?br />
鍙互浣跨敤涓嬮潰鐨勪唬鐮佽繘琛屾祴璇曪細
System.out.println(((MyCheckingAccount)em.createQuery("from MyCheckingAccount where id=12") .getSingleResult()).getBalance()); MyCheckingAccount ca = new MyCheckingAccount(); ca.setBalance(342); ca.setOverdraftLimit(120); em.persist(ca); MySavingsAccount sa = new MySavingsAccount(); sa.setBalance(200); sa.setInterestRate(321); em.persist(sa);






相关链接:



realplayer flv



WINDOWS media player psp



ts FORMAT



Rmvb Quicktime