Changes between Version 4 and Version 5 of Ja:DevelopersGuide/StyleGuide


Ignore:
Timestamp:
2018-07-07T09:22:23+02:00 (6 years ago)
Author:
anonymous
Comment:

Translate

Legend:

Unmodified
Added
Removed
Modified
  • Ja:DevelopersGuide/StyleGuide

    v4 v5  
    22= 開発ガイドライン =
    33
    4 == How your code should look like ==
     4== コードの外観 ==
    55
    6  * make sure the code is Java 8 compatible
    7  * '''Document''' your code using inline comments and javadoc. Many people will thank you :)
    8  * Try to avoid public fields
    9  * JOSM has a lot of helper methods in the `Utils`, `GuiUtils`, `Geometry` ... classes. Use them if you need
    10  * Check parameters. You can use `Objects.requireNonNull`.
    11  * Don't write for performance - write for readability. Use `Stream`s, `Function`s and other Java 8 features if they make the code more readable.
     6 * コードがJava 8と互換性があることを確認してください
     7 * インラインコメントとjavadocを使用してコードを'''ドキュメント化'''します。多くの人があなたに感謝します :)
     8 * パブリックフィールドを避けるようにしてください
     9 * JOSMは `Utils`、` GuiUtils`、 `Geometry` ...クラスに多くのヘルパーメソッドを持っています。必要に応じて使用してください
     10 * パラメータを確認してください。`Objects.requireNonNull`を使うことができます。
     11 * パフォーマンスのために記述しないでください - 読みやすいように記述してください。`Stream`、` Function`や他のJava 8の機能を使うと、コードを読みやすくします。
    1212
    1313=== Threading / Locking ===
    1414
    15  * JOSM uses various locking mechanisms, depending on the object.
    16  * The data sets are protected by a RW lock. Some methods do not automatically lock for performance reasons. Make sure to acquire the locks required for your changes.
    17  * GUI components should only be modified in the EDT thread
    18  * Prefer to use `SwingUtils.invokeLater` if you need to run anything on the UI thread
     15 * JOSMは、オブジェクトに応じてさまざまなロック機構を使用します。
     16 * データセットはRWロックによって保護されています。パフォーマンス上の理由から自動的にロックされないメソッドもあります。変更に必要なロックを取得してください。
     17 * GUIコンポーネントはEDTスレッドでのみ変更する必要があります
     18 * UIスレッドで何かを実行する必要がある場合は `SwingUtils.invokeLater`を使用することをお勧めします
    1919 * Many listeners already run in the EDT thread (layer changes) or have a central manager that allows you to register listeners that run in EDT (dataset changes, selection changes).
    2020
     
    6767== 国際化 ==
    6868
    69  * make sure you use {{{tr(...)}}} for all localized strings
     69 * ローカライズされたすべての文字列に{{{tr(...)}}}を使用するようにしてください
    7070   {{{
    7171   import import static org.openstreetmap.josm.tools.I18n.tr;
     
    8383
    8484
    85  * never assemble localized messages with {{{+}}}. Use format
    86    placeholders instead.
     85 * {{{+}}}でローカライズされたメッセージを決して組み立てることはできません。代わりに、フォーマットプレースホルダを使用してください。
    8786
    8887   '''DONT'''
     
    103102
    104103----
    105 Back to [wiki:/DevelopersGuide Developers Guide]
     104[wikitr:/DevelopersGuide Developers Guide]へ戻る